home *** CD-ROM | disk | FTP | other *** search
/ MacTech 1 to 12 / MacTech-vol-1-12.toast / Reference / the cmsp digests ('94-'97) / csmp digest Vol 3 No 143 < prev    next >
Text File  |  1996-04-10  |  87KB  |  2,410 lines

  1. C.S.M.P. Digest             Fri, 05 Apr 96       Volume 3 : Issue 143
  2.  
  3. Today's Topics:
  4.  
  5.         After 8 Choclate Strings, yum
  6.         Control? Call to colorize floppy icon?
  7.         DisposeMenu and popup menus
  8.         Drawing Controls into GWorlds
  9.         Drawing directly to the screen
  10.         Easy PICT compression?
  11.         Fixed point math on a PowerPC
  12.         How to check if volume is present ie CD-ROM
  13.         Long filenames on DOS media
  14.         Newbie: Windows vs Dialogs
  15.         PICT to Region
  16.         Quick way to tell if a file is open-busy?
  17.         Trivia:  String length limit of 200
  18.         [Ann] Pascal Central - Updated 3-18-96  (TCL page)
  19.         texture mapping
  20.  
  21.  
  22.  
  23. The Comp.Sys.Mac.Programmer Digest is moderated by Francois Pottier
  24. (pottier@clipper.ens.fr).
  25.  
  26. The digest is a collection of article threads from the internet
  27. newsgroups comp.sys.mac.programmer.help, csmp.tools, csmp.misc and
  28. csmp.games. It is designed for people who read news semi-regularly and
  29. want an archive of the discussions.  If you don't know what a
  30. newsgroup is, you probably don't have access to it. Ask your systems
  31. administrator(s) for details. If you don't have access to news, you
  32. may still be able to post messages to the group by using a mail server
  33. like anon.penet.fi (mail help@anon.penet.fi for more information).
  34.  
  35. Each issue of the digest contains one or more sets of articles (called
  36. threads), with each set corresponding to a 'discussion' of a particular
  37. subject.  The articles are not edited; all articles included in this digest
  38. are in their original posted form (as received by our news server at
  39. nef.ens.fr).  Article threads are not added to the digest until the last
  40. article added to the thread is at least two weeks old (this is to ensure that
  41. the thread is dead before adding it to the digest).  Article threads that
  42. consist of only one message are generally not included in the digest.
  43.  
  44. The digest is officially distributed by two means, by email and ftp.
  45.  
  46. If you want to receive the digest by mail, send email to listserv@ens.fr
  47. with no subject and one of the following commands as body:
  48.     help                        Sends you a summary of commands
  49.     subscribe csmp-digest Your Name    Adds you to the mailing list
  50.     signoff csmp-digest            Removes you from the list
  51. Once you have subscribed, you will automatically receive each new
  52. issue as it is created.
  53.  
  54. The official ftp info is ftp://ftp.dartmouth.edu/pub/csmp-digest.
  55. Questions related to the ftp site should be directed to
  56. scott.silver@dartmouth.edu.
  57.  
  58. -------------------------------------------------------
  59.  
  60. >From solum@telepost.no (Aleksander Solum)
  61. Subject: After 8 Choclate Strings, yum
  62. Date: 18 Mar 1996 21:25:13 GMT
  63. Organization: Solum Forlag
  64.  
  65. CHOCOLATE STRINGS! Um,try the new program: ChockStrings with a frash
  66. taste of Mint and of crunchy,fried bill gates. Glump. (don't take those
  67. two lines serisously).
  68. On with the question:
  69. Say I have a Str255 with the info "Hi". Problem is , in that string it
  70. could just as well say "Hello" which is so-and-so many chars bigger.
  71. AFTER this string , which we'll name A_String , i will print " Alex.".
  72. So "Hello" Will become "Hello Alex". (I am of course not gonna use it
  73. for that it was just an example). I have tried this code:
  74.  
  75.  
  76. short x,y;
  77. short counter ;
  78. Str255 A_String;
  79. /*initlilise main function,variables toolbox and all that*/
  80. x=20;y=30;
  81. MoveTo ( x , y );
  82. DrawString ( A_String ) ;
  83. for ( counter = 0 ; counter < A_String[0];counter++)
  84. {
  85.   x = x + TheLenghtOfAChar;
  86. }
  87. MoveTo ( x , y );
  88. x=x+TheLenghtOfAChar;
  89. MoveTo ( x ,  y );
  90. DrawString ("\pAlex");
  91. <end of code>
  92. Hwewer , that won't work cuzof ONE little thing - i don't know what to
  93. define TheLenghtOfAChar to be. I have tried 10 ,  but i geta lotof
  94. spacing between the characters. If i try 4 i get it too tight.. Any
  95. help ? 
  96. BTW i'll print in 12 pointgeneva. But a function would be better. I
  97. figure out I CAN use TeTextBox,with somting like
  98. "rect.right=rect.right+String[0]" but it would mean a complete rewrite
  99. of 3 pages of code. That is not very much i know,but i would like help
  100. anyway.
  101.  
  102.  
  103. TIA
  104. -Alex
  105. solum@telepost.no
  106.  
  107. PS:Mail The Answer To ME Since Mailservers crash (at least THAT is a
  108. REASON) regularly... Somtin like that.
  109.  
  110. -Alex
  111. solum@telepost.no
  112.  
  113.  
  114. +++++++++++++++++++++++++++
  115.  
  116. >From francois-regis.degott@imag.fr (Fr. Degott)
  117. Date: 19 Mar 1996 09:31:27 GMT
  118. Organization: LMC-IMAG
  119.  
  120. In article <4ikkbp$69a@nms.telepost.no>, solum@telepost.no (Aleksander
  121. Solum) wrote:
  122.  
  123. >[cut]
  124. > Howewer , that won't work cuzof ONE little thing - i don't know what to
  125. > define TheLenghtOfAChar to be. I have tried 10 ,  but i geta lotof
  126. > spacing between the characters. If i try 4 i get it too tight.. Any
  127. > help ? 
  128. > BTW i'll print in 12 pointgeneva. But a function would be better. I
  129. > figure out I CAN use TeTextBox,with somting like
  130. > "rect.right=rect.right+String[0]" but it would mean a complete rewrite
  131. > of 3 pages of code. That is not very much i know,but i would like help
  132. > anyway.
  133.  
  134. Hi Alex,
  135.  
  136. I hope these routines will solve your problem.
  137.  
  138. FUNCTION TextWidth (textBuf: QDPtr; firstByte,byteCount: INTEGER) : INTEGER;
  139.  
  140.     TextWidth returns the width of the text stored in the arbitrary
  141. structure in memory specified by textBuf, starting firstByte bytes into
  142. the structure and continuing for byteCount bytes. It calculates the
  143. width by adding the CharWidths of all the characters in the text. (See
  144. CharWidth, above.)
  145.  
  146. FUNCTION CharWidth (ch: CHAR) : INTEGER;
  147.  
  148.     CharWidth returns the value that will be added to the pen horizontal
  149. coordinate if the specified character is drawn. CharWidth includes the
  150. effects of the stylistic variations set with TextFace; if you change
  151. these after determining the character width but before actually drawing
  152. the character, the  predetermined width may not be correct. If the
  153. character is a space, CharWidth also includes the effect of SpaceExtra.
  154.  
  155. FUNCTION StringWidth (s: Str255 ) : INTEGER;
  156.  
  157.     StringWidth returns the width of the given text string, which it
  158. calculates by adding the CharWidths of all the characters in the string
  159. (see above). This value will be added to the pen horizontal coordinate
  160. if the specified string is drawn.
  161.  
  162. HTH
  163. Fr
  164. _____________________________________________________________________________
  165. Fr. Degott (Francois-Regis.Degott@imag.fr)
  166. LogiMath, Lab. LMC-IMAG - Grenoble - France
  167.  
  168. +++++++++++++++++++++++++++
  169.  
  170. >From Eric Grayson <wolftech@indy.net>
  171. Date: 19 Mar 1996 23:42:28 GMT
  172. Organization: Wolf Technical Services
  173.  
  174. Alex--
  175.  
  176. You're making a common mistake--
  177. Not all characters are the same width!  What you want is the width of a 
  178. space in this case, so that you can get it right.  The way to do this is 
  179. to call the CharWidth function, which will give you the width, in 
  180. pixels, of the character you pass it in the current size, style and 
  181. font.
  182.  
  183.                                                                                                                                                                                             Eric
  184.  
  185.  
  186.  
  187. ---------------------------
  188.  
  189. >From reinder@neuretp.biol.ruu.nl (Reinder Verlinde)
  190. Subject: Control? Call to colorize floppy icon?
  191. Date: Mon, 18 Mar 1996 16:41:24 +0100
  192. Organization: Rijksuniversiteit Utrecht
  193.  
  194. -1- There are some applications out which enable one to give floppies
  195.     a generic coloured icon (_without_ using any space on the floppy
  196.     in question, i.e. without giving them a custom icon)
  197.  
  198. -2- I remember vaguely that this is done by issueing a certain Control
  199.     call to the .Sony driver.
  200.  
  201. Question: what call does one have to make?
  202.  
  203. I have searched lots of TechNotes, qv databases, and IM manuals, but
  204. found nothing on this subject.
  205.  
  206. TIA,
  207.  
  208. Reinder Verlinde
  209.  
  210.  
  211. +++++++++++++++++++++++++++
  212.  
  213. >From Andrew Welch <andrew@AmbrosiaSW.com>
  214. Date: Tue, 19 Mar 1996 00:34:33 -0500
  215. Organization: Ambrosia Software, Inc.
  216.  
  217. Reinder Verlinde wrote:
  218. > -1- There are some applications out which enable one to give floppies
  219. >     a generic coloured icon (_without_ using any space on the floppy
  220. >     in question, i.e. without giving them a custom icon)
  221. > -2- I remember vaguely that this is done by issueing a certain Control
  222. >     call to the .Sony driver.
  223. > Question: what call does one have to make?
  224.  
  225. Well I wrote a hack that did this when System 7 first came out -- 
  226. because people loved the color icons, and just didn't feel complete with 
  227. the b/w icons that are on the desktop.
  228.  
  229. I did it by patching _CopyBits in the Finder and looking for the b/w 
  230. floppy icon, substituting my color pixMap for the bitmap in this case.  
  231. It's called Discolour, and I think I released the source too -- don't 
  232. remember.
  233.  
  234. +--------------------------------------------------------------+
  235. |    Andrew Welch - Thaumaturgist - Ambrosia Software, Inc.    |
  236. +-------------------------------+------------------------------+
  237. |    AOL-> Keyword: Ambrosia    |  eWorld-> Shortcut: Ambrosia |
  238. |    CIS-> GO word: Ambrosia    |  http://www.AmbrosiaSW.com/  |
  239. +-------------------------------+------------------------------+
  240.  
  241. +++++++++++++++++++++++++++
  242.  
  243. >From d88-bli@xbyse.nada.kth.se (Bo Lindbergh)
  244. Date: 20 Mar 1996 20:58:54 GMT
  245. Organization: Royal Institute of Technology, Stockholm, Sweden
  246.  
  247. Just set the kHasCustomIcon bit for the floppy without providing any icon
  248. data.  The Finder will then use icon suite -3998 from the System file.
  249.  
  250.  
  251. /Bo Lindbergh
  252.  
  253. ---------------------------
  254.  
  255. >From ekhaus3@aol.com (Ekhaus3)
  256. Subject: DisposeMenu and popup menus
  257. Date: 14 Mar 1996 00:49:26 -0500
  258. Organization: America Online, Inc. (1-800-827-6364)
  259.  
  260. hi
  261.  
  262.       just a simple question about popup menu's.   i have a modal
  263. dialog that has a popup menu that was 'loaded' from a resource
  264. and whose menu items were added at runtime with 
  265. 'AppendMenu'.  When its time to dispose this modal dialog,
  266. what am i responsible for with respect to this popup menu -
  267. namely, should i call disposemenu ?  oh yeah - this is straight
  268. C - no class library :-)
  269.  
  270. thanks
  271. dave ekhaus
  272.  
  273. +++++++++++++++++++++++++++
  274.  
  275. >From gurgle@apple.com (Pete Gontier)
  276. Date: Mon, 18 Mar 1996 16:35:34 -0800
  277. Organization: Apple Computer, Inc.
  278.  
  279. In article <4i8c16$70g@newsbf02.news.aol.com>,
  280. ekhaus3@aol.com (Ekhaus3) wrote:
  281.  
  282.   >       just a simple question about popup menu's.   i have a modal
  283.  > dialog that has a popup menu that was 'loaded' from a resource
  284.  > and whose menu items were added at runtime with 
  285.  > 'AppendMenu'.  When its time to dispose this modal dialog,
  286.  > what am i responsible for with respect to this popup menu -
  287.  > namely, should i call disposemenu ?
  288.  
  289. If you are not using the popup menu CDEF, then yes.
  290.  
  291. If you are using the popup menu CDEF and you (loaded and) inserted the
  292. menu yourself before creating the control which uses the popup menu CDEF,
  293. then yes.
  294.  
  295. Otherwise, no, the CDEF will do it for you.
  296.  
  297. - -
  298.  
  299.   Pete Gontier, Integer Poet, Apple Macintosh Developer Technical Support
  300.  
  301.   work      mail  <mailto:gurgle@apple.com>
  302.   personal  mail  <mailto:gurgle@ccnet.com>
  303.   personal  web   <http://www.ccnet.com/~gurgle>
  304.   work      web   <http://dev.info.apple.com/dts.html>
  305.  
  306. ---------------------------
  307.  
  308. >From 3gl21@qlink.queensu.ca (Gregory Lo)
  309. Subject: Drawing Controls into GWorlds
  310. Date: 23 Mar 1996 08:24:18 GMT
  311. Organization: Queen's University
  312.  
  313. I haven't looked in the FAQ for this yet, but:
  314.  
  315. How does one go about drawing controls correctly into a GWorld?
  316.  
  317. Thanx.
  318. GLo
  319.  
  320. +++++++++++++++++++++++++++
  321.  
  322. >From bzuk@telerama.lm.com (Brian Zuk)
  323. Date: Sat, 23 Mar 1996 17:02:19 -0500
  324. Organization: Telerama Public Access Internet, Pittsburgh, PA
  325.  
  326. In article <3gl21-2303960322290001@free1-slip203.tele.queensu.ca>,
  327. 3gl21@qlink.queensu.ca wrote:
  328.  
  329. >I haven't looked in the FAQ for this yet, but:
  330. >
  331. >How does one go about drawing controls correctly into a GWorld?
  332. >
  333. >Thanx.
  334. >GLo
  335.  
  336.   The safest way to do this is…
  337.  
  338. - Get the PixMapHandle from the GWorld you want the control to draw into.
  339. - Lock the GWorld's pixMap using LockPixels.
  340. - Save the PixMapHandle of the window that owns the control.
  341. - Call SetPortPix with the GWorld's PixMapHandle (make sure the window is
  342. the current port first!)
  343. - Call DrawControl
  344. - Restore the window's original PixMapHandle by calling SetPortPix with
  345. the saved PixMapHandle.
  346.  
  347. Brian Zuk
  348.  
  349. ---------------------------
  350.  
  351. >From sgs@codewell.com (Steve Sisak)
  352. Subject: Drawing directly to the screen
  353. Date: Sun, 17 Mar 1996 00:59:20 -0500
  354. Organization: Codewell Corporation
  355.  
  356. (sorry for the re-post, but it put this in the moving th cursor thread
  357. then realized it probably needed its own)
  358.  
  359. In article <4hnqoa$slj@ginger.lei.net>, Miur <urano@mail.pixi.com> wrote:
  360.  
  361. >   What sort of problems might I run into if I write directly to 
  362. > qd.screenBits.baseAddr?  I'm just concerned whether or not it will 
  363. > royally gronk someone else's computer even though it works fine on mine.  
  364. > Also, why is it that I have to multiply qd.screenBits.rowOffset by 8 to 
  365. > get the correct offset in bytes?
  366.  
  367. Don't use qd.screenBits - it assumes that the user only has one monitor -
  368. use the Graphics Device Manager to get a PixMap for the monotir you want
  369. to draw to or, better yet, draw to an offscreen GWorld and CopyBits it to
  370. the screen (this is actually faster than drawing to the screen on many
  371. systems).
  372.  
  373. In article <elliott-1503961619320001@mcmds.mpi-muelheim.mpg.de>,
  374. elliott@mpi-muelheim.mpg.de (Mark Elliott) wrote:
  375.  
  376. > In article <ericd-1403962146460001@slip3.nilenet.com>,
  377. > ericd@ra.nilenet.com (Eric A. Drumbor) wrote:
  378. > >      I couldn't agree more.  I think it's hilarious (in a pathetic sort of
  379. > > way) that Apple NOW says that there IS a compatible method for writing to
  380. > > video memory (according to another post).  There's no reason to keep this
  381.  
  382. There has _ALWAYS_ been a compatible way of writing directly to the screen
  383. on the MacOS.  Check out the chapters on the Graphics Device Manager
  384. (IM-Vol 6 ch 21, IM-Imaging w/Quickdraw, ch 5)
  385.  
  386. Call GetDeviceList to get a GDHandle for the first device and
  387. GetNextDevice to iterate through the list of montiors. You can call
  388. GetMainDevice to get the screen with the menu bar on it, but those of us
  389. with multiple monitors (640x280 8-bit and 1024x860 1-bit in my case) would
  390. appreciate it if you would see if we have a montior that meets your
  391. requirements before complaining that the main screen doesn't.  There are
  392. other routines that let you query the capabilities of the device.
  393.  
  394. In the GDHandle is a PixMapHandle to the device's storage.  If you want to
  395. manipulate the screen pixels directly, call LockPixels() then
  396. GetPixMapBaseAddr() on this PixMap.  Note that this pointer is likely to
  397. be the frame buffer and may need to be addressed in 32-bit mode - see
  398. PixMap32Bit().
  399.  
  400. You can either mainpulate the PixMap directly or draw to them with QuickDraw.
  401.   
  402. > I am a bit sceptical about ANY games API....
  403. > We can take shortcuts. We need speed.
  404.  
  405. One thing you may want to be _very_ aware of if you're concerned about speed:
  406.  
  407. Screen memory is marked UNCACHEABLE on a PowerPC (and some 68k machines)
  408. this means that it is likely to be much slower to draw to the screen
  409. directly if you do any opeations that might also read from it.  It is
  410. often much faster to draw off screen and copy the updated pixels to the
  411. screen.  NewGWorld/UpdateGWorld can be used to create an ofscreen buffer
  412. with the same depth and bit alignmennt as a particular device for this
  413. purpose.  The storage may reside on an accelerated video card and if you
  414. use CopyBits to copy the data on screen, the copy can be accomplished by
  415. the graphics accelerator without sending the pixels over the bus.
  416.  
  417. In short, trying to do everything yourself can be _slower_ than using the
  418. OS, be careful and profile your code if you really care about speed.  Then
  419. bypass the OS if you really need to.
  420.  
  421. I tend to keep the entire screen state in an offscreen GWorld, draw there
  422. and CoypBits to the screen only the areas necessary.  In low memory
  423. situations I draw directly to the screen, but have found this to be slower
  424. in most cases.
  425.  
  426. -Steve
  427.  
  428.  
  429. P.S. The calls to move the cursor are in the standard toolbox header
  430. <CursorDevices.h>  I think the Cursor Device Manager is described in a
  431. tech note - if you can't find it, send me mail and I will post its
  432. location.
  433.  
  434. ---------------------------
  435.  
  436. >From Brandon Allen <b.allen@m.cc.utah.edu>
  437. Subject: Easy PICT compression?
  438. Date: Mon, 04 Mar 1996 17:54:59 +0000
  439. Organization: University of Utah Computer Center
  440.  
  441. What is the easiest way to compress/decompress pict's for use in an 
  442. application?  I need to store a boatload of them and display them at 
  443. various times in my game. Are the QT routines the most convenient 
  444. way, or can I get hold of compression algorithms and do it myself?
  445.  
  446. Thanks,
  447. Brandon Allen
  448.  
  449. +++++++++++++++++++++++++++
  450.  
  451. >From Maf Vosburgh <maf@mmcorp.com>
  452. Date: 12 Mar 1996 17:10:47 GMT
  453. Organization: MultiMedia Corporation plc
  454.  
  455. In article <313B2E73.22DE@m.cc.utah.edu> Brandon Allen,
  456. b.allen@m.cc.utah.edu writes:
  457. >What is the easiest way to compress/decompress pict's for use in an 
  458. >application?  I need to store a boatload of them and display them at 
  459. >various times in my game. Are the QT routines the most convenient 
  460. >way, or can I get hold of compression algorithms and do it myself?
  461. >
  462.  
  463. Use QuickTime. It is fabulous.
  464. Compression is easy - just use an app like PictureCompressor. 
  465. If you want to do it in code, call  CompressPicture or
  466. CompressPictureFile.
  467.  
  468. You don't need to worry about decompression - you just call DrawPicture,
  469. and it works.
  470.  
  471. If you have a lot of images, you may want to store them in a movie.
  472. That's a fairly common trick.
  473.  
  474.  
  475. Maf
  476.  
  477. +++++++++++++++++++++++++++
  478.  
  479. >From joviansoft@aol.com (JovianSoft)
  480. Date: 21 Mar 1996 03:12:30 -0500
  481. Organization: America Online, Inc. (1-800-827-6364)
  482.  
  483. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  484. >>>
  485.  
  486. Brandon writes:
  487.  
  488. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  489. >>>
  490.  
  491. Subject: Easy PICT compression?
  492. From: Brandon Allen <b.allen@m.cc.utah.edu>
  493. Date: Tue, 05 Mar 1996 16:13:10 +0000
  494. Message-ID: <313C6816.423F@m.cc.utah.edu>
  495.  
  496. I am wondering what the easiest way to compress/decompress PICTs is. 
  497. The game I'm writing uses lots of PICTs and without compression of 
  498. some sort, the file will be enormous. Are the QT routines the 
  499. easiest way to accomplish decent compression? Or should I try to get 
  500. ahold of an algorithm and plug out the code myself?
  501.  
  502. -Brandon Allen
  503.  
  504. >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
  505.  
  506. Certainly the JPEG pictures present in System 7 are the easiest to use.
  507. However, I've noticed a few things in my own projects that you may need to
  508. do.
  509.  
  510. First, the JPEG pictures are in millions of colors. If you decode them to
  511. 8-bit or 16-bit grafports, they'll decode *very* slowly.
  512.  
  513. Second, since they decode slowly no matter what, you may need to keep what
  514. you can in RAM to get good performance out of them. Naturally if you use a
  515. lot of graphics simultaneously, you won't be able to do this. So it's a
  516. tradeoff between speed versus RAM (sound familiar?).
  517.  
  518. Third, JPEG is lossy, even on the "maximum" setting. This is usually not a
  519. problem, but is visible under certain circumstances. My only problem with
  520. it was with stylized text that was inside a larger screen.
  521.  
  522. Other than that, it's really simple. I use JPEG for my very large pictures
  523. that don't move. Some of the smaller sizes I don't compress for speed
  524. reasons.
  525.  
  526. +++++++++++++++++++++++++++
  527.  
  528. >From heaney@crl.com (John S. Heaney)
  529. Date: 21 Mar 1996 11:31:48 -0800
  530. Organization: CRL Dialup Internet Access    (415) 705-6060  [Login: guest]
  531.  
  532. >Brandon writes:
  533. >
  534. >I am wondering what the easiest way to compress/decompress PICTs is. 
  535. >The game I'm writing uses lots of PICTs and without compression of 
  536. >some sort, the file will be enormous. Are the QT routines the 
  537. >easiest way to accomplish decent compression? Or should I try to get 
  538. >ahold of an algorithm and plug out the code myself?
  539.  
  540. JovianSoft <joviansoft@aol.com> wrote:
  541. >Certainly the JPEG pictures present in System 7 are the easiest to use.
  542. >However, I've noticed a few things in my own projects that you may need to
  543. >do.
  544. >
  545. >First, the JPEG pictures are in millions of colors. If you decode them to
  546. >8-bit or 16-bit grafports, they'll decode *very* slowly.
  547. >
  548. >Second, since they decode slowly no matter what, you may need to keep what
  549. >you can in RAM to get good performance out of them. Naturally if you use a
  550. >lot of graphics simultaneously, you won't be able to do this. So it's a
  551. >tradeoff between speed versus RAM (sound familiar?).
  552. >
  553. >Third, JPEG is lossy, even on the "maximum" setting. This is usually not a
  554. >problem, but is visible under certain circumstances. My only problem with
  555. >it was with stylized text that was inside a larger screen.
  556. >
  557. >Other than that, it's really simple. I use JPEG for my very large pictures
  558. >that don't move. Some of the smaller sizes I don't compress for speed
  559. >reasons.
  560.  
  561. You can use QuickTime compression on 8 bit images also. I've started 
  562. doing this recently. I've got 8 bit background images that are in the 
  563. 200K range. I go into DeBabelizer and apply the QuickTime still 
  564. conversion. I set codec to Graphics and the quality to 100%. There's 
  565. another option in there--a popup--that I set to Color. It's a depth setting.
  566.  
  567. The result is about a 40% savings or so. It varies. I don't have to make 
  568. any changes to my code to draw the picture, as DrawPicture knows enough 
  569. to call QT to decompress it. It definitely takes longer to draw the 
  570. picture, but it's a tradeoff between that extra time and the savings in 
  571. getting the picture off the CD.
  572.  
  573. I switched back and forth between the compressed and uncompressed image 
  574. and it looks to be lossless using it this way. Furthermore, I use custom 
  575. palettes up the wazoo. Smaller graphics that appear on top of the 
  576. compressed image use the same palette. I'm not having any color mapping 
  577. problems, so the palette is obviously being preserved.
  578.  
  579. There is only one problem I have noticed and the workaround is simple. 
  580. Since I have to switch palettes all over the place, I have to fade the 
  581. screen to black, update the screen and fade up to the new colors. This 
  582. requires extensive use of the ctSeed slam so that the graphics don't all 
  583. remap to black while drawing to the faded down screen. The QT compressed 
  584. still does not work with the ctSeed slam. I can only conclude that the 
  585. graphic routines are not creating a PixMap and sending the result through 
  586. the StdBits grafProc, which is where I do one of my ctSeed slams. The 
  587. result is remapping the graphic to black, which becomes a white screen 
  588. when I fade up the colors.
  589.  
  590. The workaround is to first draw the QT compressed image into an offscreen 
  591. with the correct clut. Then I can update the screen with the offscreen 
  592. image doing a ctSeed slammed CopyBits. Since I want the background in an 
  593. offscreen anyway this isn't really a problem.
  594.  
  595. Let me clarify one thing. My original artwork is 24-bit photo realistic. I
  596. use Debab to dither it down to 8-bit. This gives me explicit control over
  597. the palette. Then I use the QT compression on that. 
  598.  
  599. Your mileage may vary.
  600. -- 
  601. John Heaney              Time flies whether you're having fun or not.
  602. heaney@crl.com
  603.  
  604. +++++++++++++++++++++++++++
  605.  
  606. >From demos@xmission.com (Dmitry Boldyrev)
  607. Date: Wed, 20 Mar 1996 19:57:32 -0700
  608. Organization: Xenix Demo Group
  609.  
  610. In article <4ir31e$g0h@newsbf02.news.aol.com>, joviansoft@aol.com
  611. (JovianSoft) wrote:
  612.  
  613. > I am wondering what the easiest way to compress/decompress PICTs is. 
  614. > The game I'm writing uses lots of PICTs and without compression of 
  615.  
  616. Well, many different ways. I personally adopted LZSS compression engine
  617. to do fast decompression of picts. It is called LZSS Res. If you're interested,
  618. gimme a call (801) 581-5465 local at the UofU.
  619.  
  620. Demos
  621.  
  622. ---------------------------
  623.  
  624. >From jmunkki@beta.hut.fi (Juri Munkki)
  625. Subject: Fixed point math on a PowerPC
  626. Date: 28 Feb 1996 17:57:04 GMT
  627. Organization: Helsinki University of Technology
  628.  
  629. Supposing you had to emulate fixed point math perfectly on a PowerPC
  630. processor, what would be the best way to do a fixed point division
  631. operation? What would be the best way to do a multiply and divide
  632. (using 64 bit intermediate result)?
  633.  
  634. The PowerPC architecture doesn't seem to have a division of a 64 bit
  635. integer by a 32 bit integer. Does anyone know what method Apple uses
  636. to emulate this 68020 instruction on the PowerPC?
  637.  
  638. The quick and dirty solution is to use the floating point divide, but
  639. I'm worried about resolution. The results have to be exactly the same
  640. as on a 68020.
  641.  
  642. -- 
  643. Juri Munkki jmunkki@iki.fi        Life is easy when polygons are cheap.
  644. http://www.iki.fi/jmunkki           Windsurfing: Faster than the wind.
  645.  
  646. +++++++++++++++++++++++++++
  647.  
  648. >From bernardi@mathp6.jussieu.fr (Dominique Bernardi)
  649. Date: Thu, 29 Feb 1996 10:23:33 +0100
  650. Organization: Université Pierre & Marie Curie
  651.  
  652. In article (Dans l'article) <4h251g$hm@nntp.hut.fi>, jmunkki@beta.hut.fi
  653. (Juri Munkki) wrote (écrivait) :
  654.  
  655. >Supposing you had to emulate fixed point math perfectly on a PowerPC
  656. >processor, what would be the best way to do a fixed point division
  657. >operation? What would be the best way to do a multiply and divide
  658. >(using 64 bit intermediate result)?
  659. >
  660. >The PowerPC architecture doesn't seem to have a division of a 64 bit
  661. >integer by a 32 bit integer. Does anyone know what method Apple uses
  662. >to emulate this 68020 instruction on the PowerPC?
  663. >
  664. >The quick and dirty solution is to use the floating point divide, but
  665. >I'm worried about resolution. The results have to be exactly the same
  666. >as on a 68020.
  667.  
  668. I have done only the unsigned operation, because I needed those only.
  669. You may use the following as you wish.
  670.  
  671. The global variable hiremainder contains the high 32 bits of the result
  672. in a multiplication 32 x 32 -> 64 bits, the high 32 bits of the dividend
  673. and the remainder in a division 64 / 32 -> 32 bit quotient and 32 bit
  674. remainder.
  675. The division operation *assumes* the result fits in 32 bits.
  676. HTH.
  677.  
  678. typedef unsigned long ulong;
  679. ulong hiremainder;
  680.  
  681. asm ulong
  682. mulll(ulong x, ulong y)
  683. {
  684.       mulhwu   r5,r3,r4
  685.       lwz      r6,hiremainder(RTOC)
  686.       stw      r5,0(r6)
  687.       mullw r3,r3,r4
  688.       blr
  689. }
  690.  
  691. asm ulong
  692. divll(ulong x, ulong y)
  693. {
  694.    lwz      r5,hiremainder(RTOC)
  695.    lwz      r0,0(r5)
  696.    cmplwi   r0,0
  697.    bne      @1
  698.  
  699. //  hiremainder = x % y;
  700. //  return x/y;
  701.    divwu    r0,r3,r4
  702.    mullw    r4,r0,r4
  703.    sub      r4,r3,r4
  704.    mr       r3,r0
  705.    stw      r4,0(r5)
  706.    blr
  707.    
  708. @1 cmplwi   r4,0xffff
  709.    bgt      @2
  710.    
  711. //  hiremainder = GLUE(hiremainder, HIGHWORD(x));
  712.    rlwinm   r0,r0,16,0,15
  713.    rlwimi   r0,r3,16,16,31
  714. //  q1 = hiremainder / y;
  715. //  hiremainder = GLUE(hiremainder % y, LOWWORD(x));
  716.    divwu    r6,r0,r4
  717.    mullw    r7,r6,r4
  718.    sub      r0,r0,r7
  719.    rlwimi   r3,r0,16,0,15
  720.    mr       r0,r3
  721. //  q2 = hiremainder / y;
  722. //  hiremainder = hiremainder % y;
  723. //  return GLUE(q1, q2);
  724.    divwu    r3,r3,r4
  725.    mullw    r7,r3,r4
  726.    sub      r7,r0,r7
  727.    stw      r7,0(r5)
  728.    rlwimi   r3,r6,16,0,15
  729.    blr
  730.  
  731. //  k = bfffo(y);
  732. @2 cntlzw   r7,r4
  733. //  hiremainder = (hiremainder << k) + (x >> (BITS_IN_LONG - k));
  734. //  x <<= k; y <<= k;
  735.    slw      r0,r0,r7
  736.    subfic   r6,r7,32
  737.    slw      r4,r4,r7
  738.    srw      r8,r3,r6
  739.    or       r0,r0,r8
  740.    slw      r3,r3,r7
  741. //  SPLIT(y, yh, y);
  742. //  SPLIT(x, xh, x);
  743. //  q1 = hiremainder / yh; if (q1 > LOWMASK) q1 = LOWMASK;
  744. //  hiremainder -= q1 * yh;
  745. //  aux = y * q1;
  746.    rlwinm   r9,r4,16,16,31
  747.    divwu    r6,r0,r9
  748.    rlwinm   r10,r3,16,16,31
  749.    cmplwi   r6,0xffff
  750.    rlwinm   r4,r4,0,16,31
  751.    rlwinm   r3,r3,0,16,31
  752.    ble      @5
  753.    lis      r6,1
  754.    subi     r6,r6,1
  755. @5 mullw    r8,r6,r9
  756.    mullw    r12,r4,r6
  757.    sub      r0,r0,r8
  758.  
  759. //  again:
  760. //  SPLIT(aux, aux1, q2);
  761. //  if (q2 > xh) aux1++;
  762. //  if (aux1 > hiremainder)
  763. //  {q1--; hiremainder += yh; aux -= y; goto again;}  
  764. @6 rlwinm   r11,r12,0,16,31
  765.    cmplw    r11,r10
  766.    rlwinm   r8,r12,16,16,31
  767.    ble      @7
  768.    addi     r8,r8,1
  769. @7 cmplw    r8,r0
  770.    ble      @8
  771.    add      r0,r0,r9
  772.    subi     r6,r6,1
  773.    sub      r12,r12,r4
  774.    b        @6
  775.  
  776. //  hiremainder = GLUE(hiremainder - aux1, LOWWORD(xh - q2));
  777. @8  sub      r8,r0,r8
  778.    sub      r0,r10,r11
  779.    rlwimi   r0,r8,16,0,15
  780. //  q2 = hiremainder / yh; if (q2 > LOWMASK) q2 = LOWMASK;
  781. //  hiremainder -= q2 * yh;
  782. //  aux = y * q2;
  783.    divwu    r11,r0,r9
  784.    cmplwi   r11,0xffff
  785.    ble      @9
  786.    lis      r11,1
  787.    subi     r11,r11,1
  788. @9 mullw    r8,r11,r9
  789.    mullw    r12,r4,r11
  790.    sub      r0,r0,r8
  791.  
  792. //  again2:
  793. //  SPLIT(aux, aux1, xh);
  794. //  if (xh > x) aux1++;
  795. //  if (aux1 > hiremainder)
  796. //  {q2--; hiremainder += yh; aux -= y; goto again2;}
  797. @10   rlwinm   r10,r12,0,16,31
  798.    cmplw    r10,r3
  799.    rlwinm   r8,r12,16,16,31
  800.    ble      @11
  801.    addi     r8,r8,1
  802. @11 cmplw    r8,r0
  803.    ble      @12
  804.    add      r0,r0,r9
  805.    subi     r11,r11,1
  806.    sub      r12,r12,r4
  807.    b        @10
  808.    
  809. //  hiremainder = GLUE(hiremainder - aux1, LOWWORD(x - xh)) >> k;
  810. //  return GLUE(q1, q2);
  811. @12   sub      r4,r0,r8
  812.    sub      r0,r3,r10
  813.    rlwimi   r0,r4,16,0,15
  814.    srw      r0,r0,r7
  815.    stw      r0,0(r5)
  816.    mr       r3,r11
  817.    rlwimi   r3,r6,16,0,15
  818.    blr
  819. }
  820. -- 
  821. Dominique Bernardi, Theorie des Nombres
  822. Universite Pierre et Marie Curie
  823. 4 place Jussieu - F75005 Paris Tel (33-1) 44275441
  824. bernardi@mathp6.jussieu.fr
  825.  
  826. +++++++++++++++++++++++++++
  827.  
  828. >From karm@bga.com (Kevin Armstrong)
  829. Date: Thu, 29 Feb 1996 00:59:32 -0600
  830. Organization: Lion Entertainment, Inc.
  831.  
  832. In article <4h251g$hm@nntp.hut.fi>, jmunkki@beta.hut.fi (Juri Munkki) wrote:
  833.  
  834. >Supposing you had to emulate fixed point math perfectly on a PowerPC
  835. >processor, what would be the best way to do a fixed point division
  836. >operation? What would be the best way to do a multiply and divide
  837. >(using 64 bit intermediate result)?
  838. >
  839. >The PowerPC architecture doesn't seem to have a division of a 64 bit
  840. >integer by a 32 bit integer. Does anyone know what method Apple uses
  841. >to emulate this 68020 instruction on the PowerPC?
  842. >
  843. >The quick and dirty solution is to use the floating point divide, but
  844. >I'm worried about resolution. The results have to be exactly the same
  845. >as on a 68020.
  846.  
  847. I'd like to second this request.  I've done a fixed point divide in the
  848. floating point unit without too much of a precision problem, but the
  849. convert to and from floating point is taking up tons of time.
  850.  
  851. Maybe I should make a feature request for future PowerPC processors.  I'd
  852. like to see 2 64-bit integer registers on the 32-bit CPUs.  I know this is
  853. a pain, but it would make some things very nice.  Especially fixed-point
  854. math.
  855.  
  856. For those of you thinking that I should just use the floating point unit,
  857. I would if I wasn't getting data from the rest of the program as fixed
  858. point.  So if there is a PowerPC integer based fixed-point solution,
  859. please post one.
  860.  
  861. >-- 
  862. >Juri Munkki jmunkki@iki.fi              Life is easy when polygons are cheap.
  863. >http://www.iki.fi/jmunkki                  Windsurfing: Faster than the wind.
  864.  
  865. Kevin Armstrong
  866. Lion Entertainment, Inc.
  867.  
  868. +++++++++++++++++++++++++++
  869.  
  870. >From Carl R. Osterwald <carl_osterwald@nrel.gov>
  871. Date: 29 Feb 1996 16:29:00 GMT
  872. Organization: National Renewable Energy Laboratory
  873.  
  874. In article <bernardi-2902961023330001@sigma.mathp6.jussieu.fr> Dominique
  875. Bernardi, bernardi@mathp6.jussieu.fr writes:
  876.  
  877. >>Supposing you had to emulate fixed point math perfectly on a PowerPC
  878. >>processor, what would be the best way to do a fixed point division
  879. >>operation? What would be the best way to do a multiply and divide
  880. >>(using 64 bit intermediate result)?
  881.  
  882. >>The PowerPC architecture doesn't seem to have a division of a 64 bit
  883. >>integer by a 32 bit integer. Does anyone know what method Apple uses
  884. >>to emulate this 68020 instruction on the PowerPC?
  885.  
  886. >>The quick and dirty solution is to use the floating point divide, but
  887. >>I'm worried about resolution. The results have to be exactly the same
  888. >>as on a 68020.
  889.  
  890. >I have done only the unsigned operation, because I needed those only.
  891. >You may use the following as you wish.
  892.  
  893. Apparently Apple felt that the resolution is adequate because the new
  894. system 7.5.3 patches include a replacement for the fixed-point math
  895. routines that use the PowerPC FPU. According to tech note 1017,
  896.  
  897. "Rounding and pinning still matches the previous PowerPC implementation
  898. (which is slightly different from its 68K counterpart); users of the
  899. fixed math routines, however, should not see a difference in the
  900. behaviour of the package, aside from faster execution."
  901.  
  902. QuickDraw uses the fixed math routines a lot, so one might expect that
  903. the FPU solution gives the right answer.
  904.  
  905. +++++++++++++++++++++++++++
  906.  
  907. >From jmunkki@beta.hut.fi (Juri Munkki)
  908. Date: 1 Mar 1996 08:22:09 GMT
  909. Organization: Helsinki University of Technology
  910.  
  911. In article <karm-2902960059320001@jake-5j.ip.realtime.net> karm@bga.com (Kevin Armstrong) writes:
  912. >Maybe I should make a feature request for future PowerPC processors.  I'd
  913. >like to see 2 64-bit integer registers on the 32-bit CPUs.  I know this is
  914. >a pain, but it would make some things very nice.  Especially fixed-point
  915. >math.
  916.  
  917. Even if it happened, it wouldn't make any difference. The old PPC reference
  918. guide I have here says that there is a 64/32 bit divide (as well as a
  919. 32*32->64 multiply) that is not part of the PowerPC architecture. I think
  920. this means it is a 601 only instruction. This leaves the 603 and 604 without
  921. the instruction, so it is not very useful unless you want to go to the
  922. absolute maximum speed on an almost obsolete processor (just kidding for
  923. the sake of the pun).
  924.  
  925. >For those of you thinking that I should just use the floating point unit,
  926. >I would if I wasn't getting data from the rest of the program as fixed
  927. >point.  So if there is a PowerPC integer based fixed-point solution,
  928. >please post one.
  929.  
  930. The floating point solution seems viable, but a division loop might actually
  931. be quite fast too. I don't have a PPC to test it with though. I know there
  932. are RISC processors without any kind of hardware divide, but with a division
  933. step instruction that enables division to be done almost as quickly as in
  934. hardware. It's possible there might be a way to even avoid some of the
  935. conditional branching...I would have to study the PPC instruction set more
  936. closely and see how it could be used in this case.
  937.  
  938. At the moment I think the most likely solution is a customized fixed to
  939. double conversion with a double precision floating point divide.
  940.  
  941. I don't have a PPC to play with, so all this is just theoretical for me.
  942.  
  943. -- 
  944. Juri Munkki jmunkki@iki.fi        Life is easy when polygons are cheap.
  945. http://www.iki.fi/jmunkki           Windsurfing: Faster than the wind.
  946.  
  947. +++++++++++++++++++++++++++
  948.  
  949. >From gav@mag1.magmacom.com (Gavriel State)
  950. Date: 1 Mar 1996 17:36:05 -0500
  951. Organization: none
  952.  
  953. In article <4h251g$hm@nntp.hut.fi>, Juri Munkki <jmunkki@beta.hut.fi> wrote:
  954. >Supposing you had to emulate fixed point math perfectly on a PowerPC
  955. >processor, what would be the best way to do a fixed point division
  956. >operation? What would be the best way to do a multiply and divide
  957. >(using 64 bit intermediate result)?
  958.  
  959. Convert to double, multiply, divide, and convert back.  
  960.  
  961. Floats won't have the accuracy you want, and fooling around with 
  962. mullhw and mullw (not to mention trying to divide the intermediate 
  963. 64-bit result) isn't going to be any faster, and in fact will probably
  964. be slower.  It'll also be harder to code.
  965.  
  966. --
  967.      Gavriel State | Macintosh Software Engineer | Corel Corporation
  968. - ------------------------------------------------------------------------
  969.             I don't speak for Corel...at least, I usually don't.
  970.  
  971. +++++++++++++++++++++++++++
  972.  
  973. >From agiles@sirius.com (Aaron Giles)
  974. Date: Fri, 01 Mar 1996 23:16:18 -0800
  975. Organization: Sirius Connections
  976.  
  977. In article <karm-2902960059320001@jake-5j.ip.realtime.net>, karm@bga.com
  978. (Kevin Armstrong) wrote:
  979.  
  980. > In article <4h251g$hm@nntp.hut.fi>, jmunkki@beta.hut.fi (Juri Munkki) wrote:
  981. > >The PowerPC architecture doesn't seem to have a division of a 64 bit
  982. > >integer by a 32 bit integer. Does anyone know what method Apple uses
  983. > >to emulate this 68020 instruction on the PowerPC?
  984. > >
  985. > >The quick and dirty solution is to use the floating point divide, but
  986. > >I'm worried about resolution. The results have to be exactly the same
  987. > >as on a 68020.
  988. > I'd like to second this request.  I've done a fixed point divide in the
  989. > floating point unit without too much of a precision problem, but the
  990. > convert to and from floating point is taking up tons of time.
  991. > For those of you thinking that I should just use the floating point unit,
  992. > I would if I wasn't getting data from the rest of the program as fixed
  993. > point.  So if there is a PowerPC integer based fixed-point solution,
  994. > please post one.
  995.  
  996. At one of the first PowerPC games kitchens (where LucasArts, Lion, and
  997. Bungie were working on Dark Forces, Doom 2, and Marathon, respectively)
  998. this issue came up and a number of solutions were proposed.  Eric Traut,
  999. the man behind the DR emulator, was there and wrote a nifty bit of
  1000. hand-tweaked PPC assembly to do the 64/32-bit divide using integer math. 
  1001. The code for the 32x32->64-bit multiply was trivial (3 or 4 assembly
  1002. instructions).
  1003.  
  1004. Then I sat down and compared results between the integer assembly code and
  1005. some quick convert-to-float-then-multiply/divide-then-convert-back macros
  1006. running on the 601 machines there.
  1007.  
  1008. The assembly language integer multiply (using high/low multiplies) came
  1009. out about 2x faster than the convert-to-float macros.  This was a big win.
  1010.  
  1011. The assembly language integer divide was a tad bit slower than the
  1012. convert-to-float macros.  It was also a lot more complicated (and hence
  1013. more error-prone).  We stuck with the macros.  I wouldn't waste my time
  1014. doing the assembly code, unless you really really want to. :-)
  1015.  
  1016. Hope this helps,
  1017. Aaron
  1018. -- 
  1019. Aaron Giles
  1020. agiles@sirius.com
  1021. Opinions expressed herein are mine and not my employer's
  1022.  
  1023. +++++++++++++++++++++++++++
  1024.  
  1025. >From jmunkki@beta.hut.fi (Juri Munkki)
  1026. Date: 2 Mar 1996 12:05:15 GMT
  1027. Organization: Helsinki University of Technology
  1028.  
  1029. In article <agiles-0103962316180001@ppp146-sf1.sirius.com> agiles@sirius.com (Aaron Giles) writes:
  1030. >The assembly language integer divide was a tad bit slower than the
  1031. >convert-to-float macros.  It was also a lot more complicated (and hence
  1032. >more error-prone).  We stuck with the macros.  I wouldn't waste my time
  1033. >doing the assembly code, unless you really really want to. :-)
  1034.  
  1035. Hmmm...well, I guess the fp solution with tweaked fixed to fp conversion
  1036. could be done with pure C.
  1037.  
  1038. The combined multiply/divide is easier, because no scaling needs to be done.
  1039.  
  1040. For the divide, I would do something like this (I haven't tested if this
  1041. works on PPC...wether it works or not depends on what happens to two
  1042. denormalized numbers that are divided. The book says they are normalized
  1043. internally, but it doesn't say if there is loss of accuracy. The code works
  1044. on a 68040 with doubles set to 8 bytes, but of course the fpu of the 040 is
  1045. different from the PPC):
  1046.  
  1047. Fixed    FDivC(
  1048.     Fixed    a,
  1049.     Fixed    b)
  1050. {
  1051. static    short    doubleFudgePlus[4] = { 0, 0, 0, 0 };
  1052. static    short    doubleFudgeMinus[4] = { 0x8000, 0, 0, 0 };
  1053. static    long    doubleFudgeB[2] = { 0, 0 };
  1054.  
  1055.     if(b < 0)
  1056.     {    doubleFudgeB[1] = -b;
  1057.  
  1058.         if(a < 0)
  1059.         {    *(long *)(1+doubleFudgePlus) = -a;
  1060.             return    * (double *) doubleFudgePlus /
  1061.                 * (double *) doubleFudgeB;
  1062.         }
  1063.         else
  1064.         {    *(long *)(1+doubleFudgeMinus) = a;
  1065.             return    * (double *) doubleFudgeMinus /
  1066.                 * (double *) doubleFudgeB;
  1067.         }
  1068.     }
  1069.     else
  1070.     {    doubleFudgeB[1] = b;
  1071.  
  1072.         if(a >= 0)
  1073.         {    *(long *)(1+doubleFudgePlus) = a;
  1074.             return    * (double *) doubleFudgePlus /
  1075.                 * (double *) doubleFudgeB;
  1076.         }
  1077.         else
  1078.         {    *(long *)(1+doubleFudgeMinus) = -a;
  1079.             return    * (double *) doubleFudgeMinus /
  1080.                 * (double *) doubleFudgeB;
  1081.         }
  1082.     }
  1083. }
  1084.  
  1085. The above code does not handle division by zero. It will also probably
  1086. not produce the same result as the toolbox FixDiv (or one implemented
  1087. with a true 64/32 divide), because it probably doesn't round the results
  1088. the same way when converting back to Fixed.
  1089.  
  1090. Last, but not least, overflow is not detected or handled.
  1091.  
  1092. In other words it's pretty much useless for emulating 68K code behavior.
  1093.  
  1094. -- 
  1095. Juri Munkki jmunkki@iki.fi        Life is easy when polygons are cheap.
  1096. http://www.iki.fi/jmunkki           Windsurfing: Faster than the wind.
  1097.  
  1098. +++++++++++++++++++++++++++
  1099.  
  1100. >From rickgenter@aol.com (RickGenter)
  1101. Date: 2 Mar 1996 21:08:08 -0500
  1102. Organization: America Online, Inc. (1-800-827-6364)
  1103.  
  1104. >>>
  1105. Convert to double, multiply, divide, and convert back.  
  1106.  
  1107. Floats won't have the accuracy you want, and fooling around with 
  1108. mullhw and mullw (not to mention trying to divide the intermediate 
  1109. 64-bit result) isn't going to be any faster, and in fact will probably
  1110. be slower.  It'll also be harder to code.
  1111. <<<
  1112.  
  1113. GACK! You can do a fixed point 64 by 32 bit divide using a small number of
  1114. 32-by-16 bit divides (4?) and appropriate surrounding math. This is more
  1115. accurate than converting to double and back (since a double only has 53
  1116. bits of precision).
  1117.  
  1118. Rick Genter
  1119. Papyrus Design Group, Inc.
  1120.  
  1121. +++++++++++++++++++++++++++
  1122.  
  1123. >From dpasca@val.net (Davide Pasca)
  1124. Date: Tue, 05 Mar 1996 13:16:29 GMT
  1125. Organization: ValNet, Inc.
  1126.  
  1127. jmunkki@beta.hut.fi (Juri Munkki) wrote:
  1128.  
  1129. >Supposing you had to emulate fixed point math perfectly on a PowerPC
  1130. >processor, what would be the best way to do a fixed point division
  1131. >operation? What would be the best way to do a multiply and divide
  1132. >(using 64 bit intermediate result)?
  1133.  
  1134. Wow, this is exactly the info I was looking for !
  1135.  
  1136. >The PowerPC architecture doesn't seem to have a division of a 64 bit
  1137. >integer by a 32 bit integer. Does anyone know what method Apple uses
  1138. >to emulate this 68020 instruction on the PowerPC?
  1139.  
  1140. >The quick and dirty solution is to use the floating point divide, but
  1141. >I'm worried about resolution. The results have to be exactly the same
  1142. >as on a 68020.
  1143.  
  1144. Besides it is slower to convert to float and back to integer.
  1145. I've tried to track the FixMul() and FixDiv() both with MacsBug and
  1146. the CW Debugger. In the 1st case it seems to be 68K code (if I rem correctly),
  1147. in the second case the function seems to jump somewhere else where the
  1148. debugger is blind..
  1149. I definitely don't know PPC asm.
  1150.  
  1151. If you know something about it then, please, let me know.
  1152.  
  1153. Thanks !
  1154.  
  1155. ciaox
  1156.  
  1157. //=========================================================
  1158. // Davide Pasca: dpasca@val.net | d.pasca@agora.stm.it
  1159. //     Homepage: http://val.net/~dpasca
  1160. //=========================================================
  1161.  
  1162. >-- 
  1163. >Juri Munkki jmunkki@iki.fi        Life is easy when polygons are cheap.
  1164. >http://www.iki.fi/jmunkki           Windsurfing: Faster than the wind.
  1165.  
  1166. //=========================================================
  1167. // Davide Pasca: dpasca@val.net | d.pasca@agora.stm.it
  1168. //     Homepage: http://val.net/~dpasca
  1169. //=========================================================
  1170.  
  1171.  
  1172. +++++++++++++++++++++++++++
  1173.  
  1174. >From page@best.com (Chris Page)
  1175. Date: Thu, 07 Mar 1996 22:57:32 -0800
  1176. Organization: Don't Panic!
  1177.  
  1178. In article <4hk2uc$dfj@ooze.val.net>, dpasca@val.net (Davide Pasca) wrote:
  1179.  
  1180. > Besides it is slower to convert to float and back to integer.
  1181.  
  1182. Well, I believe the next system update (to 7.5.3) will include a new,
  1183. PowerPC implementation of the Toolbox fixed-point math routines. I read
  1184. that it performs at least some of the operations by converting to
  1185. floating-point (then back). For some FP operations, the conversion time
  1186. may not be a big hit (I don't know for sure).
  1187.  
  1188. -- 
  1189. Chris Page        | Internet chain letters, advertisements and SPAMs suck...
  1190. Don't Panic!      | 
  1191. page@best.com     |                   Cut it out! :-P
  1192.  
  1193. +++++++++++++++++++++++++++
  1194.  
  1195. >From gav@mag1.magmacom.com (Gavriel State)
  1196. Date: 11 Mar 1996 00:48:54 -0500
  1197. Organization: none
  1198.  
  1199. In article <4hauu8$vb@newsbf02.news.aol.com>,
  1200. RickGenter <rickgenter@aol.com> wrote:
  1201. >>>>
  1202. >Convert to double, multiply, divide, and convert back.  
  1203. >
  1204. >Floats won't have the accuracy you want, and fooling around with 
  1205. >mullhw and mullw (not to mention trying to divide the intermediate 
  1206. >64-bit result) isn't going to be any faster, and in fact will probably
  1207. >be slower.  It'll also be harder to code.
  1208. ><<<
  1209. >
  1210. >GACK! You can do a fixed point 64 by 32 bit divide using a small number of
  1211. >32-by-16 bit divides (4?) and appropriate surrounding math. This is more
  1212. >accurate than converting to double and back (since a double only has 53
  1213. >bits of precision).
  1214.  
  1215. When you're converting back to a 32-bit value, what does it matter
  1216. that you've lost 11 bits of precision in the intermediate value?
  1217.  
  1218. Conversion to and from doubles takes about 3 cheap instructions each way.  
  1219. Once you've got the doubles, you do two expensive instructions (the mul
  1220. and the div) and convert back.  In pure fixed point, you'll have six 
  1221. expensive instructions (two muls and four divs), and your surrounding
  1222. math is likely to be more expensive than the int->fp and fp->int conversions.
  1223.  
  1224. On a CPU that has built-in support for long multiplies and divides, yes, it's
  1225. usually better than converting to fp.  This is just not the case on a PPC.
  1226.  
  1227. --
  1228.      Gavriel State | Macintosh Software Engineer | Corel Corporation
  1229. - ------------------------------------------------------------------------
  1230.             I don't speak for Corel...at least, I usually don't.
  1231.  
  1232. +++++++++++++++++++++++++++
  1233.  
  1234. >From demos@xmission.com (Dmitry Boldyrev)
  1235. Date: Thu, 14 Mar 1996 04:09:21 +0100
  1236. Organization: Xenix Demo Group
  1237.  
  1238.  
  1239. > On a CPU that has built-in support for long multiplies and divides, yes, it's
  1240. > usually better than converting to fp.  This is just not the case on a PPC.
  1241. > --
  1242. >      Gavriel State | Macintosh Software Engineer | Corel Corporation
  1243. > --------------------------------------------------------------------------
  1244. >             I don't speak for Corel...at least, I usually don't.
  1245.  
  1246. Actaully, I didn't notice any big differences between using integer 
  1247. arithmetics and floating point arithmetics on PPC. I do realize that
  1248. PowerPC has two separate units to handle floating and integer arithmetics
  1249. but still.
  1250.  
  1251. Demos
  1252.  
  1253. +++++++++++++++++++++++++++
  1254.  
  1255. >From zzkbergm@dingo.uq.edu.au (Christoph Bergmann)
  1256. Date: Sun, 17 Mar 1996 20:59:48 +1000
  1257. Organization: University of Queensland
  1258.  
  1259. > Actaully, I didn't notice any big differences between using integer 
  1260. > arithmetics and floating point arithmetics on PPC. I do realize that
  1261. > PowerPC has two separate units to handle floating and integer arithmetics
  1262. > but still.
  1263. > Demos
  1264.  
  1265. if you use numbers of any given precision, ie. all floats, or all integer,
  1266. then floating doubles _are_ the fastest by quite some on a powerpc (or at
  1267. least my 601 :). if u are using floats and often converting to integer,
  1268. consider using integer because the convert requires at least 2-3
  1269. instructions..
  1270.  
  1271. chrisb
  1272.  
  1273. +++++++++++++++++++++++++++
  1274.  
  1275. >From bwanga@cats.ucsc.edu (Timothy A. Seufert)
  1276. Date: Sun, 17 Mar 1996 18:16:57 -0800
  1277. Organization: Evil Geniuses For A Better Tomorrow
  1278.  
  1279. In article <zzkbergm-1703962059480001@zzkbergm.slip.cc.uq.oz.au>,
  1280. zzkbergm@dingo.uq.edu.au (Christoph Bergmann) wrote:
  1281.  
  1282. >if you use numbers of any given precision, ie. all floats, or all integer,
  1283. >then floating doubles _are_ the fastest by quite some on a powerpc (or at
  1284. >least my 601 :).
  1285.  
  1286. Single precision FP is faster than double precision on the 601.  Its FPU
  1287. has to use two passes to do a double precision computation.  Later models,
  1288. like the 604, have no speed penalty for doubles.
  1289.  
  1290. +-----------------------------------------------------------+
  1291. |Tim Seufert, bwanga@cats.ucsc.edu | UselessWastedSpace(tm) |
  1292. | "I never give them hell. I just tell the truth, and they  |
  1293. |  think it is hell."  -Harry S Truman                      |
  1294. +-----------------------------------------------------------+
  1295.  
  1296. +++++++++++++++++++++++++++
  1297.  
  1298. >From Lawson English <english@primenet.com>
  1299. Date: 17 Mar 1996 21:20:01 -0700
  1300. Organization: Primenet (602)395-1010
  1301.  
  1302. Timothy A. Seufert <bwanga@cats.ucsc.edu> wrote:
  1303. [snipt]
  1304. : Single precision FP is faster than double precision on the 601.  Its FPU
  1305. : has to use two passes to do a double precision computation.  Later models,
  1306. : like the 604, have no speed penalty for doubles.
  1307.  
  1308.  
  1309. There is still the problems with loading them. While you can only load 
  1310. one single or one double with a single read instruction, more singles fit 
  1311. in a single cache line than do doubles, so you can process them faster.
  1312.  
  1313.  
  1314. This this wont be quite as big a deal on the 604e as it is on earlier 
  1315. processors, but 
  1316. even the 604e takes more  time to load from  a new cache line then from 
  1317. in the cache, even if you can often make use of the data sooner than you 
  1318. could with older PPCs.
  1319.  
  1320. --
  1321. - -----------------------------------------------------------------------------
  1322. Lawson English                            __  __     ____  ___       ___ ____
  1323. english@primenet.com                     /__)/__) / / / / /_  /\  / /_    /
  1324.                                         /   / \  / / / / /__ /  \/ /___  /
  1325. - -----------------------------------------------------------------------------
  1326.  
  1327. +++++++++++++++++++++++++++
  1328.  
  1329. >From zzkbergm@dingo.uq.edu.au (Christoph Bergmann)
  1330. Date: Mon, 18 Mar 1996 17:54:29 +1000
  1331. Organization: University of Queensland
  1332.  
  1333. In article <bwanga-1703961816570001@metricom38.ucsc.edu>,
  1334. bwanga@cats.ucsc.edu (Timothy A. Seufert) wrote:
  1335.  
  1336. > In article <zzkbergm-1703962059480001@zzkbergm.slip.cc.uq.oz.au>,
  1337. > zzkbergm@dingo.uq.edu.au (Christoph Bergmann) wrote:
  1338. > >if you use numbers of any given precision, ie. all floats, or all integer,
  1339. > >then floating doubles _are_ the fastest by quite some on a powerpc (or at
  1340. > >least my 601 :).
  1341. > Single precision FP is faster than double precision on the 601.  Its FPU
  1342. > has to use two passes to do a double precision computation.  Later models,
  1343. > like the 604, have no speed penalty for doubles.
  1344.  
  1345. maybe. my timing runs show the order from fastest to slowest to be:
  1346. doubles, floats, longs, shorts. this partially depends upon what
  1347. operations one is using, but it is the major trend.
  1348. i wont go as far as to say it _is_ this way, i havent studied it a lot :)
  1349. but this is the timing values i get and i think i saw some docs that back
  1350. that up..
  1351. anyway, as always, do some tests to see which is better in the given situ
  1352. you are using.
  1353.  
  1354. chris
  1355.  
  1356. +++++++++++++++++++++++++++
  1357.  
  1358. >From demos@xmission.com (Dmitry Boldyrev)
  1359. Date: Wed, 20 Mar 1996 20:36:43 -0700
  1360. Organization: Xenix Demo Group
  1361.  
  1362. In article <zzkbergm-1703962059480001@zzkbergm.slip.cc.uq.oz.au>,
  1363. zzkbergm@dingo.uq.edu.au (Christoph Bergmann) wrote:
  1364.  
  1365. > if you use numbers of any given precision, ie. all floats, or all integer,
  1366. > then floating doubles _are_ the fastest by quite some on a powerpc (or at
  1367. > least my 601 :). if u are using floats and often converting to integer,
  1368. > consider using integer because the convert requires at least 2-3
  1369. > instructions..
  1370. > chrisb
  1371.  
  1372. As I said, I didn't notice much difference, but I realize, it doesn't
  1373. make much sense because there are two ALU blocks for fpu and integer
  1374. arithmetics. Hmph.
  1375.  
  1376. Demos
  1377.  
  1378. ---------------------------
  1379.  
  1380. >From brewski@twics.com (Brian Sweeney)
  1381. Subject: How to check if volume is present ie CD-ROM
  1382. Date: 5 Mar 1996 06:13:41 GMT
  1383. Organization: Twics Co. Ltd., Japan
  1384.  
  1385. I am writing an application that will be placed on the users Hard Disk and
  1386. will read data from different CD-ROMS.
  1387. How do I check that the CD-ROM is loaded ie A volume of Name "Disk1"
  1388. without trying to open a file on the disk
  1389. I tried
  1390.    err = GetVol(OldVName,&OldVRef);
  1391.    err = SetVol(TestVName,0);
  1392.    err = GetVol(OldVName2,&OldVRef2);
  1393.    .
  1394.    .
  1395.    .
  1396.    .
  1397.  etc
  1398. But it did not set to volume TestVName even though there was no error ie 
  1399. OldVName2 was not equal to TestVName but still remained the same as
  1400. OldVName but err was always 0.
  1401.  
  1402. At best this way is sloppy and I would like a cleaner method.
  1403.  
  1404. +++++++++++++++++++++++++++
  1405.  
  1406. >From allender@il.pxsoftware.com (Mark Allender)
  1407. Date: Thu, 07 Mar 1996 14:44:03 GMT
  1408. Organization: Parallax Software
  1409.  
  1410. brewski@twics.com (Brian Sweeney) wrote:
  1411.  
  1412. >How do I check that the CD-ROM is loaded ie A volume of Name "Disk1"
  1413. >without trying to open a file on the disk
  1414.  
  1415. Actually, there is no *real* way to tell (which is ridiculous IMHO).
  1416. There is a document that can be found on the developer CD's which will
  1417. walk you through a series of several things that you can do to
  1418. determine if a particular volume is a CDROM drive (the name --
  1419. 'How to Detect a CDROM drive' or something similar to that).  I don't
  1420. have my notes or CD's handy, so I can't verify.
  1421.  
  1422. In short, the ways that are outlined in this document are not
  1423. foolproof for determining if a vol. is a cd or not, but they are the
  1424. best you have, and probably work in 99% of all cases.
  1425.  
  1426. email me if you have trouble locating it, and I'll dig it up and send
  1427. it along.
  1428. --
  1429. Mark Allender
  1430. Parallax Software
  1431. allender@il.pxsoftware.com
  1432.  
  1433.  
  1434. +++++++++++++++++++++++++++
  1435.  
  1436. >From jumplong@aol.com (Jump Long)
  1437. Date: 9 Mar 1996 01:21:13 -0500
  1438. Organization: America Online, Inc. (1-800-827-6364)
  1439.  
  1440. Brian Sweeney wrote:
  1441. >I am writing an application that will be placed on the users
  1442. >Hard Disk and will read data from different CD-ROMS. How do I
  1443. >check that the CD-ROM is loaded ie A volume of Name "Disk1"
  1444. >without trying to open a file on the disk
  1445.  
  1446. If you have access to the CD-ROMs when you build your application, you can
  1447. simply use NewAlias to create aliases to each CD and store them in your
  1448. appplication's resource fork (or another file) as 'alis' resources.
  1449.  
  1450. Then, when your program wants one of the CD-ROM volumes, it only has to
  1451. load the 'alis' resource for that volume and call ResolveAlias. If the
  1452. volume isn't mounted, the Alias Manager will take care of the user
  1453. interface chore of ejecting the current CD-ROM (if there are no CD-ROM
  1454. drives empty), and asking for the CD-ROM you want.
  1455.  
  1456. If you only want to know if the volume is mounted or not without ejecting
  1457. disks or asking for the volume, then you can call MatchAlias with the
  1458. kARMNoUI rule instead of calling ResolveAlias. With the kARMNoUI rule, the
  1459. Alias Manager doesn't try to mount the volume and returns nsvErr (-35) if
  1460. the volume is not already mounted.
  1461.  
  1462. - Jim Luther
  1463.  
  1464. +++++++++++++++++++++++++++
  1465.  
  1466. >From gurgle@apple.com (Pete Gontier)
  1467. Date: Mon, 18 Mar 1996 17:06:13 -0800
  1468. Organization: Apple Computer, Inc.
  1469.  
  1470. In article <4hmscu$nv2@client1.news.psi.net>,
  1471. allender@il.pxsoftware.com wrote:
  1472.  
  1473.  > ...there is no *real* way to tell (which is ridiculous IMHO).
  1474.  
  1475. Correct on both counts.
  1476.  
  1477.  > There is a document that can be found on the developer CD's which will
  1478.  > walk you through a series of several things that you can do to
  1479.  > determine if a particular volume is a CDROM drive (the name --
  1480.  > 'How to Detect a CDROM drive' or something similar to that).  I don't
  1481.  > have my notes or CD's handy, so I can't verify.
  1482.  
  1483. The best I was able to find is pasted at the bottom of this message.
  1484.  
  1485.  > In short, the ways that are outlined in this document are not
  1486.  > foolproof for determining if a vol. is a cd or not, but they are the
  1487.  > best you have, and probably work in 99% of all cases.
  1488.  
  1489. Once again, very true.
  1490.  
  1491. - ------
  1492.  
  1493.  > For a CD in High Sierra, ISO 9660, or audio-only formats, you can use
  1494.  > PBHGetVInfo to check for the ioVFSID (file system ID).
  1495.  >
  1496.  > High Sierra disks always have an FSID of 0x4242. ISO 9660 disks always
  1497.  > have an FSID of 0x4147. Audio CDs always have an FSID of 0x4A48.
  1498.  > You should also check for a hardware locked device by checking the ioVAtrb
  1499.  > field. The bits for this are defined on page 167 of Inside Macintosh
  1500.  > Volume IV.
  1501.  >
  1502.  > For the AppleCD SC drive, you can call the driver with a PBstatus call of
  1503.  > 97. csParam+1 contains bits corresponding to each of the eight possible
  1504.  > SCSI IDs. SCSI ID 0 is the rightmost bit. A bit is set if an AppleCD SC
  1505.  > drive exists at that SCSI ID. See the AppleCD SC Developer’s Guide,
  1506.  > available from APDA, for further details.
  1507.  
  1508. - -
  1509.  
  1510.   Pete Gontier, Integer Poet, Apple Macintosh Developer Technical Support
  1511.  
  1512.   work      mail  <mailto:gurgle@apple.com>
  1513.   personal  mail  <mailto:gurgle@ccnet.com>
  1514.   personal  web   <http://www.ccnet.com/~gurgle>
  1515.   work      web   <http://dev.info.apple.com/dts.html>
  1516.  
  1517. +++++++++++++++++++++++++++
  1518.  
  1519. >From hsoi@tamu.edu (John C. Daub)
  1520. Date: 20 Mar 1996 04:12:17 GMT
  1521. Organization: Wish I Had More Of It
  1522.  
  1523. In article <gurgle-1803961706130001@gontpe.apple.com>, gurgle@apple.com
  1524. (Pete Gontier) wrote:
  1525.  
  1526. > In article <4hmscu$nv2@client1.news.psi.net>,
  1527. > allender@il.pxsoftware.com wrote:
  1528. >  > ...there is no *real* way to tell (which is ridiculous IMHO).
  1529. > Correct on both counts.
  1530. > The best I was able to find is pasted at the bottom of this message.
  1531. >  > In short, the ways that are outlined in this document are not
  1532. >  > foolproof for determining if a vol. is a cd or not, but they are the
  1533. >  > best you have, and probably work in 99% of all cases.
  1534. > Once again, very true.
  1535. > --------
  1536. >  > For a CD in High Sierra, ISO 9660, or audio-only formats, you can use
  1537. >  > PBHGetVInfo to check for the ioVFSID (file system ID).
  1538. >  >
  1539. >  > High Sierra disks always have an FSID of 0x4242. ISO 9660 disks always
  1540. >  > have an FSID of 0x4147. Audio CDs always have an FSID of 0x4A48.
  1541. >  > You should also check for a hardware locked device by checking the ioVAtrb
  1542. >  > field. The bits for this are defined on page 167 of Inside Macintosh
  1543. >  > Volume IV.
  1544. >  >
  1545. >  > For the AppleCD SC drive, you can call the driver with a PBstatus call of
  1546. >  > 97. csParam+1 contains bits corresponding to each of the eight possible
  1547. >  > SCSI IDs. SCSI ID 0 is the rightmost bit. A bit is set if an AppleCD SC
  1548. >  > drive exists at that SCSI ID. See the AppleCD SC Developer’s Guide,
  1549. >  > available from APDA, for further details.
  1550.  
  1551. going on the suggestion in the second paragraph, checking the hardware locked
  1552. bit is a nice simple quick way to "assume" a CD-ROM.
  1553.  
  1554. but there could be a "flaw" in that....what if it's a floppy disk with the
  1555. little lock tab up?  i've never tried this sort of programming checking
  1556. stuff, so i might be opening my mouth when i shouldn't be...
  1557.  
  1558. so, there was a little thing i saw in some network admin software that
  1559. might prove a handy helped to this "locked hardware" thing.
  1560.  
  1561. check the size of the volume.  this admin software considers volumes to be
  1562. CD ROMs if 1. they are locked, and 2. if over a certain number of megabytes
  1563. in size, default like 237 megs, but the user can set it to wahtever they want.
  1564.  
  1565. that's kinda nice at least to perhaps avoid locked 3.5" 1.44MB floppies (and
  1566. smaller).  but of course, who knows how much info and space any given CD-ROM
  1567. will have on it...maye 650megs, maybe 50.
  1568.  
  1569. so again, not a 100% way, but perhaps a little extension of an aforementioned
  1570. technique?
  1571.  
  1572. -- 
  1573. John C. Daub (aka Hsoi)   | <mailto:hsoi@tamu.edu>
  1574. Grad Student, Lab Manager | <http://http.tamu.edu:8000/~jcd7106/>
  1575. Self-proclaimed Mac Guru  | Department of Speech Communication
  1576. Will program for food.    | Texas A&M University, USA
  1577.  
  1578. "Ain't it funny how that money rots your brain?"  -COC
  1579.  
  1580.  
  1581. +++++++++++++++++++++++++++
  1582.  
  1583. >From blob@ccnet.com
  1584. Date: Wed, 20 Mar 1996 21:27:22 -0800
  1585. Organization: CCnet Communications (510-988-7140 guest)
  1586.  
  1587. In article <hsoi-1903962217400001@ppp16-17.rns.tamu.edu>, hsoi@tamu.edu
  1588. (John C. Daub) wrote:
  1589.  
  1590. > In article <gurgle-1803961706130001@gontpe.apple.com>, gurgle@apple.com
  1591. > (Pete Gontier) wrote:
  1592. > > In article <4hmscu$nv2@client1.news.psi.net>,
  1593. > > allender@il.pxsoftware.com wrote:
  1594. > > 
  1595. > >  > ...there is no *real* way to tell (which is ridiculous IMHO).
  1596. > > 
  1597. > > Correct on both counts.
  1598.  
  1599. There is sample code on the tool chest developer CD in the Snippets
  1600. section which demonstrates many of the ways to determine if you are
  1601. talking to a CD-ROM.  For every case you can come up with, there is an
  1602. exception which proves it wrong.  You really can't tell reliably 100% of
  1603. the time.  It's strange, it's stupid, but it's true.  You get close enough
  1604. and wing it.
  1605.  
  1606. ---------------------------
  1607.  
  1608. >From elliott@teaching.physics.ox.ac.uk  (John Elliott)
  1609. Subject: Long filenames on DOS media
  1610. Date: 7 Mar 1996 23:39:47 GMT
  1611. Organization: Oxford University
  1612.  
  1613.   PC Exchange lets you use Mac filenames on DOS discs. How (precisely) are 
  1614. the filenames stored on the DOS disc? 
  1615.   (ie, I know they're in a hidden file, but which one, and what's the 
  1616. technique to read them?)
  1617.  
  1618. - ------------------ http://sable.ox.ac.uk/~sjoh0132/ ---------------------
  1619. John Elliott           |BLOODNOK: "But why have you got such a long face?"
  1620.                        |SEAGOON: "Heavy dentures, Sir!"    - The Goon Show 
  1621. :-------------------------------------------------------------------------)
  1622.  
  1623. +++++++++++++++++++++++++++
  1624.  
  1625. >From jumplong@aol.com (Jump Long)
  1626. Date: 12 Mar 1996 01:58:30 -0500
  1627. Organization: America Online, Inc. (1-800-827-6364)
  1628.  
  1629. John Elliott wrote:
  1630. >  PC Exchange lets you use Mac filenames on DOS discs. How
  1631. >(precisely) are  the filenames stored on the DOS disc? 
  1632. >  (ie, I know they're in a hidden file, but which one, and
  1633. >what's the  technique to read them?)
  1634.  
  1635. How they are stored isn't documented and won't be because there's a really
  1636. good chance that the method will change in the future.
  1637.  
  1638. - Jim Luther
  1639.  
  1640. +++++++++++++++++++++++++++
  1641.  
  1642. >From m_weinstein@msn.com (Mark Weinstein)
  1643. Date: 12 Mar 96 05:02:20 -0800
  1644. Organization: The Microsoft Network (msn.com)
  1645.  
  1646. >PC Exchange lets you use Mac filenames on DOS discs. How (precisely) are 
  1647. >the filenames stored on the DOS disc?     (ie, I know they're in a hidden 
  1648. >file, but which one, and what's the technique to read them?)
  1649.  
  1650. The name of the file PC Exchange and DOS Mounter 5.0 and up use is 
  1651. called "FINDER.DAT".  You will basically find one of these files in 
  1652. EVERY single subdirectory of the DOS disk.  
  1653. Both programs support the identical format, which comprises a series 
  1654. of 96-byte structures, each describing one file on the disk.  The 
  1655. entries are NOT sorted.  Each structure or record contains the long 
  1656. filename, "finfo" and "fxinfo" structures (or dinfo/dxinfo for 
  1657. directories), backup/creation dates, the DOS short name equivalent, 
  1658. and a bunch of other stuff.  The record layout relatively 
  1659. straightforward.
  1660.  
  1661. The structure sequence, however, is bizarre; for a floppy disk, 
  1662. starting at offset 0 of the file, five records are stored 
  1663. sequentially, which gets you to offset 480.  Then the file is padded 
  1664. with nothingness until offset 512, where the sixth record begins.  
  1665. Basically, every 512 bytes, a new record begins.
  1666. The way the structures are used is simple; PC Exchange/DOS Mounter 
  1667. find a DOS name first, then rifle through the FINDER.DAT file in that 
  1668. directory looking for the matching "record" for that DOS file.  They 
  1669. both use a "short name" field of the 96-byte record to determine when 
  1670. a match is found.  [Thus, if you go to your DOS machine and rename 
  1671. the file, it's long name will no longer show up on the mac..]  Once 
  1672. it finds it, it gets the rest of the data.  If no record exists, it 
  1673. is filled with default information and stored.
  1674.  
  1675. Also, there is an additional file on the disk, called "FILEID.DAT".  
  1676. This file exists only in the root, and is responsible for managing 
  1677. fileID's of files on the disk, to support the ID functions 
  1678. (CreateFileIDRef(), ResolveFileIDRef(), etc).  This file is the 
  1679. reason you can use alias's on DOS disks.
  1680.  
  1681. --
  1682. The other similar products in that class use similar techniques; 
  1683. AccessPC uses "APCINFO.DAT", and older Dayna DOS Mounter versions use 
  1684. a hidden "DAYNARID.SYS" store the extra Mac-specific.  But the 
  1685. formats of these are a little different, but Access PC's is similar.
  1686.  
  1687. I am not sure how much more detail you want.  If you want more, just ask..  
  1688.  
  1689. Hope this helped.  m_weinstein@msn.com
  1690.  
  1691. +++++++++++++++++++++++++++
  1692.  
  1693. >From ldo@waikato.ac.nz (Lawrence D'Oliveiro)
  1694. Date: Wed, 20 Mar 1996 16:32:20 +1200
  1695. Organization: University of Waikato
  1696.  
  1697. In article <4i37am$a3o@newsbf02.news.aol.com>, jumplong@aol.com (Jump
  1698. Long) wrote:
  1699.  
  1700. >John Elliott wrote:
  1701. >>  PC Exchange lets you use Mac filenames on DOS discs. How
  1702. >>(precisely) are  the filenames stored on the DOS disc? 
  1703. >>  (ie, I know they're in a hidden file, but which one, and
  1704. >>what's the  technique to read them?)
  1705. >
  1706. >How they are stored isn't documented and won't be because there's a really
  1707. >good chance that the method will change in the future.
  1708.  
  1709. That kind of argument can be applied to code and internal data structures,
  1710. but not to persistent data structures. Remember, whatever it's changed to
  1711. in future, it must still remain backward-compatible with the file/disk
  1712. structures that are being written today.
  1713.  
  1714.  
  1715. ---------------------------
  1716.  
  1717. >From 73045.734@compuserve.com (Robert E Otto)
  1718. Subject: Newbie: Windows vs Dialogs
  1719. Date: 16 Mar 1996 22:45:19 GMT
  1720. Organization: REO Associates
  1721.  
  1722. I have just spent the last six weeks going thru Metowerk's "Programming
  1723. Starter Kit". Great book.  I am now just beginning to program my own
  1724. application.
  1725.  
  1726. I am completely uncertain about the tradeoffs between dialogs and windows.
  1727.  
  1728. I want to program an instrument panel. It will have sliders, buttons,
  1729. strip charts, and graphical areas.  Scrolling within a document will not
  1730. be an issue. The panel will always be the size of the current window (but
  1731. it will have a grow box). Jim's CDEFs look just like the things I need.
  1732.  
  1733. What issues do I need to consider? Apple's CD Audio player doesn't seem to
  1734. use anything. Sound Maching uses dialogs. Do dialogs limit you in any way?
  1735.  
  1736. Any help will be greatly appreciated.
  1737.  
  1738. -- 
  1739. Bob Otto
  1740. St Louis
  1741. 38.612 N 90.482 W
  1742.  
  1743. +++++++++++++++++++++++++++
  1744.  
  1745. >From 'Digital Dave' Shields <digidave@vvstudios.com>
  1746. Date: Sun, 17 Mar 1996 00:00:40 -0800
  1747. Organization: Vanguard Vision Studios, San Francisco, CA
  1748.  
  1749. Robert E Otto wrote:
  1750. > I have just spent the last six weeks going thru Metowerk's "Programming
  1751. > Starter Kit". Great book.  I am now just beginning to program my own
  1752. > application.
  1753. > I am completely uncertain about the tradeoffs between dialogs and windows.
  1754. > I want to program an instrument panel. It will have sliders, buttons,
  1755. > strip charts, and graphical areas.  Scrolling within a document will not
  1756. > be an issue. The panel will always be the size of the current window (but
  1757. > it will have a grow box). Jim's CDEFs look just like the things I need.
  1758. > What issues do I need to consider? Apple's CD Audio player doesn't seem to
  1759. > use anything. Sound Maching uses dialogs. Do dialogs limit you in any way?
  1760.  
  1761. The idea behind Dialogs is that they are a type of window which 
  1762. originate from a template of resources. These resources are stored in 
  1763. the resource fork of your application. Use ResEdit to open a copy of any 
  1764. application, and look at the DLOG and corresponding DITL resources which 
  1765. share the same ID number. See how they are described.
  1766.  
  1767. Once you use ResEdit or ReSourcer to create these DLOG and DITL types of 
  1768. resources, you can set up a Dialog Window and refer to its controls, 
  1769. called Dialog Items, by ID number. Updates for the controls are managed 
  1770. by the Dialog manager.
  1771.  
  1772. The alternative, using regular Windows, is that you have to keep and 
  1773. manage the handles to all Controls which go on it. You can create 
  1774. controls for windows, and manage their updating yourself. But if you 
  1775. have a lot of controls (more than just scrollBars) you would probably be 
  1776. better using Dialogs.
  1777.  
  1778. There are two kinds of Dialogs--modal (which do not allow the user to 
  1779. continue until he has dismissed the Dialog Window), and modeless--which 
  1780. allow the user to click outside the Dialog and return to it like any 
  1781. other kind of Window. The purpose of Modal Dialogs is to display 
  1782. something the user must confirm seeing or make a choice about. You don't 
  1783. want him wandering off--this item needs attention now...
  1784.  
  1785. So, with modal dialogs, there is a special routine that keeps returning 
  1786. the 'DITL' item which gets hit upon by the user. It is called 
  1787. "ModalDialog()". Using it within a do loop, keeps the Dialog from 
  1788. getting dismissed, until the correct item is hit (which you define.)
  1789.  
  1790. Another sub-category of Dialog is called an Alert. Alerts are Dialogs 
  1791. which have the ModalDialog routine built into them. You can use 'ALRT' 
  1792. resources and corresponding 'DITL' resources to define a Dialog Box 
  1793. which posts a simple cautionary or warning message (or even a diagnostic 
  1794. one.)
  1795.  
  1796. Happy Windows programming...ooops...Forgive me...I mean happy coding 
  1797. windows and dialogs on your Mac...:-)
  1798.  
  1799. --Dave
  1800.  
  1801. +++++++++++++++++++++++++++
  1802.  
  1803. >From gurgle@apple.com (Pete Gontier)
  1804. Date: Mon, 18 Mar 1996 15:25:51 -0800
  1805. Organization: Apple Computer, Inc.
  1806.  
  1807. In article <73045.734-1603961651330001@pm5x15.dialip.mo.net>,
  1808. 73045.734@compuserve.com (Robert E Otto) wrote:
  1809.  
  1810.  > Do dialogs limit you in any way?
  1811.  
  1812. Yes. In plenty of ways.
  1813.  
  1814. The example that comes to mind is text editing. editText items are not
  1815. very versatile and very difficult to customize. You can use an 'ictb'
  1816. resource to specify font, size, style, etc. info for an individual
  1817. editText item as long as you're happy with the entire editText item being
  1818. the same all the way through and not changing. And it's not easy to edit
  1819. large chunks of text or add scroll bars to editText items.
  1820.  
  1821. Most all of the other dialog components have roughly equivalent limitations. 
  1822.  
  1823. However, if you plan to do most of the interesting parts of your interface
  1824. through custom controls, you might be OK.
  1825.  
  1826. - -
  1827.  
  1828.   Pete Gontier, Integer Poet, Apple Macintosh Developer Technical Support
  1829.  
  1830.   work      mail  <mailto:gurgle@apple.com>
  1831.   personal  mail  <mailto:gurgle@ccnet.com>
  1832.   personal  web   <http://www.ccnet.com/~gurgle>
  1833.   work      web   <http://dev.info.apple.com/dts.html>
  1834.  
  1835. ---------------------------
  1836.  
  1837. >From vanzon@gemini.tfdl.agro.nl (Ed van Zon - FD, Min.LNV)
  1838. Subject: PICT to Region
  1839. Date: 4 Mar 96 09:50:25 +0100
  1840. Organization: TFDL Wageningen, The Netherlands
  1841.  
  1842. I want to get the region exactly enclosing a given PICT.
  1843.  
  1844. How I tried it:
  1845.   OpenRgn
  1846.   DrawPict
  1847.   CloseRgn
  1848. Now the region is considerable smaller than the PICT.
  1849. I tried the kludge:
  1850.   InsetRgn( rgn, -1, -1)
  1851. Now the region _almost_ encloses the PICT exactly; there are just
  1852. a few pixels the region includes outside the PICTs outline. But this still
  1853. isn't good enough for me.
  1854.  
  1855. The PICT was authored using SuperPaint; it's a polygon with linewidth 2
  1856. (it has the form of a hexagon, but I'm _not_ using the hexagon-shape tool).
  1857. After pasting this into the resource fork, it draws correctly on screen.
  1858. So why is it that drawing it into a region, the region is just too small?
  1859.  
  1860. Anybody got a suggestion, or even a solution to what I want?
  1861. I would appreciate it very much if you share it with me.
  1862.  
  1863. Ed van Zon
  1864. vanzon@tfdl.agro.nl
  1865.  
  1866.  
  1867. +++++++++++++++++++++++++++
  1868.  
  1869. >From yennie@aol.com (Yennie)
  1870. Date: 4 Mar 1996 15:42:06 -0500
  1871. Organization: America Online, Inc. (1-800-827-6364)
  1872.  
  1873. If your PICT is a simple shape, I would just draw it manually:
  1874. OpenRgn
  1875. MoveTo x,y
  1876. LineTo x1,y1
  1877. MoveTo x1,y1
  1878. LineTo x2,y2
  1879. ......
  1880. LineTo x,y
  1881. CloseRgn
  1882.  
  1883. One other suggestion: when drawing the PICT (I assume you are using
  1884. DrawPicture which takes a PICT handle and a rectangle as parameters), are
  1885. you sure you're using the correct rectangle? I believe you should use the
  1886. rectangle pictHandle@@.pictBounds (that field name might not be right, but
  1887. its something like that).
  1888.  
  1889. Good luck!
  1890.  
  1891. +++++++++++++++++++++++++++
  1892.  
  1893. >From ost@loki.mh.nl (Job Oostindie)
  1894. Date: Tue, 5 Mar 1996 07:07:38 GMT
  1895. Organization: Multihouse Automatisering b.v.
  1896.  
  1897. Ed van Zon - FD, Min.LNV (vanzon@gemini.tfdl.agro.nl) wrote:
  1898. : I want to get the region exactly enclosing a given PICT.
  1899.  
  1900. : How I tried it:
  1901. :   OpenRgn
  1902. :   DrawPict
  1903. :   CloseRgn
  1904. : Now the region is considerable smaller than the PICT.
  1905. : I tried the kludge:
  1906. :   InsetRgn( rgn, -1, -1)
  1907. : Now the region _almost_ encloses the PICT exactly; there are just
  1908. : a few pixels the region includes outside the PICTs outline. But this still
  1909. : isn't good enough for me.
  1910.  
  1911. The problem may be the pensize. The pensize expands any drawn object with
  1912. xPenSize pixels to the right and yPenSize pixels downwards.
  1913. So, when you used pensize( 2, 2 ) to draw the picture, I think you need to
  1914. InsetRgn( rgn, -1, -1 ) and afterwards OffsetRgn( rgn, -1, -1) 
  1915. Hope this helps.
  1916.  
  1917. +------------------------------------------------------------------------+
  1918. |  Job Oostindie                    Information Engineer                 |
  1919. |  Email: ost@mh.nl                 Multihouse Automatisering B.V.       |
  1920. |  Phone: (+31)318-612917           Holland                              |
  1921. |  Fax:   (+31)318-612917                                                |
  1922. +------------------------------------------------------------------------+
  1923.  
  1924. +++++++++++++++++++++++++++
  1925.  
  1926. >From mouser@zercom.net (Martin-Gilles Lavoie)
  1927. Date: Tue, 05 Mar 1996 08:30:56 -0500
  1928. Organization: Groupimage, inc.
  1929.  
  1930. In article <1996Mar4.095025.378@ns2>, vanzon@gemini.tfdl.agro.nl wrote:
  1931.  
  1932. > I want to get the region exactly enclosing a given PICT.
  1933. > How I tried it:
  1934. >   OpenRgn
  1935. >   DrawPict
  1936. >   CloseRgn
  1937. > Now the region is considerable smaller than the PICT.
  1938. > I tried the kludge:
  1939. >   InsetRgn( rgn, -1, -1)
  1940. > Now the region _almost_ encloses the PICT exactly; there are just
  1941. > a few pixels the region includes outside the PICTs outline. But this still
  1942. > isn't good enough for me.
  1943. > The PICT was authored using SuperPaint; it's a polygon with linewidth 2
  1944. > (it has the form of a hexagon, but I'm _not_ using the hexagon-shape tool).
  1945. > After pasting this into the resource fork, it draws correctly on screen.
  1946. > So why is it that drawing it into a region, the region is just too small?
  1947. > Anybody got a suggestion, or even a solution to what I want?
  1948. > I would appreciate it very much if you share it with me.
  1949. > Ed van Zon
  1950. > vanzon@tfdl.agro.nl
  1951.  
  1952. Unfortunatelly, regions dont take into account the thickness of lines when
  1953. they are being constructed using PenSize(>1,>1).  A workaround is to use
  1954. the BitmapToRegion() function (described in QuickDraw chapters of Inside
  1955. Mac).
  1956.  
  1957. This function converts a bitmap or pixmap into a region.  However, it's
  1958. not perfect.
  1959.  
  1960. -- 
  1961. Martin-Gilles Lavoie
  1962.  
  1963. [CYRNFR QB ABG ZVK BE BGUREJVFR NYGRE GUR OVGF VA GUVF ZRFFNTR.]
  1964.  
  1965. +++++++++++++++++++++++++++
  1966.  
  1967. >From edvanzon@euronet.nl (Ed van Zon)
  1968. Date: Wed, 06 Mar 1996 19:55:19 +0100
  1969. Organization: Solar Software
  1970.  
  1971. In article <mouser-0503960830560001@204.191.6.170>, mouser@zercom.net
  1972. (Martin-Gilles Lavoie) wrote:
  1973.  
  1974. > In article <1996Mar4.095025.378@ns2>, vanzon@gemini.tfdl.agro.nl wrote:
  1975. > > I want to get the region exactly enclosing a given PICT.
  1976. > Unfortunatelly, regions dont take into account the thickness of lines when
  1977. > they are being constructed using PenSize(>1,>1).  A workaround is to use
  1978. > the BitmapToRegion() function (described in QuickDraw chapters of Inside
  1979. > Mac).
  1980. > This function converts a bitmap or pixmap into a region.  However, it's
  1981. > not perfect.
  1982. > -- 
  1983. > Martin-Gilles Lavoie
  1984. > [CYRNFR QB ABG ZVK BE BGUREJVFR NYGRE GUR OVGF VA GUVF ZRFFNTR.]
  1985.  
  1986. Thanks for the pointer to BitmapToRegion(). It indeed solved my problem.
  1987.  
  1988. Ed.
  1989.  
  1990. +++++++++++++++++++++++++++
  1991.  
  1992. >From gurgle@apple.com (Pete Gontier)
  1993. Date: Mon, 18 Mar 1996 16:03:49 -0800
  1994. Organization: Apple Computer, Inc.
  1995.  
  1996. In article <Dns94r.6IL@argus.mh.nl>,
  1997. ost@loki.mh.nl (Job Oostindie) wrote:
  1998.  
  1999.  > Ed van Zon - FD, Min.LNV (vanzon@gemini.tfdl.agro.nl) wrote:
  2000.  > : I want to get the region exactly enclosing a given PICT.
  2001.  > 
  2002.  > : How I tried it:
  2003.  > :   OpenRgn
  2004.  > :   DrawPict
  2005.  > :   CloseRgn
  2006.  > : Now the region is considerable smaller than the PICT.
  2007.  
  2008. I don't think DrawPicture is going to do what you want.
  2009.  
  2010. Pictures can have embedded region and polygon operations. Some of these
  2011. are likely to require calls to OpenRgn or OpenPoly. On page 3-88 of Inside
  2012. Mac: Imaging with QuickDraw, we see: "Do not call OpenRgn while another
  2013. region or polygon is open." This is due to the way a temporary storage
  2014. handle is allocated in the current GrafPort. There's only one handle per
  2015. GrafPort.
  2016.  
  2017. Also: Pictures can be large. On page 3-88 of Inside Mac: Imaging with
  2018. QuickDraw, we see: "Regions are limited to 32Kb (...or...) 64Kb..."
  2019.  
  2020. You might try HidePen and filtering some of the QuickDraw bottlenecks to
  2021. keep track of the limits of drawing. You'll probably want to look up the
  2022. calls SetStdProcs and SetStdCProcs in the aforementioned volumes for more
  2023. info.
  2024.  
  2025. - -
  2026.  
  2027.   Pete Gontier, Integer Poet, Apple Macintosh Developer Technical Support
  2028.  
  2029.   work      mail  <mailto:gurgle@apple.com>
  2030.   personal  mail  <mailto:gurgle@ccnet.com>
  2031.   personal  web   <http://www.ccnet.com/~gurgle>
  2032.   work      web   <http://dev.info.apple.com/dts.html>
  2033.  
  2034. +++++++++++++++++++++++++++
  2035.  
  2036. >From j-jahnke@uchicago.edu (Jerome Jahnke)
  2037. Date: Wed, 20 Mar 1996 04:08:24 GMT
  2038. Organization: BSD Academic Computing
  2039.  
  2040. In article <gurgle-1803961603490001@gontpe.apple.com>, gurgle@apple.com
  2041. (Pete Gontier) wrote:
  2042.  
  2043. > In article <Dns94r.6IL@argus.mh.nl>,
  2044. > ost@loki.mh.nl (Job Oostindie) wrote:
  2045. >  > Ed van Zon - FD, Min.LNV (vanzon@gemini.tfdl.agro.nl) wrote:
  2046. >  > : I want to get the region exactly enclosing a given PICT.
  2047. >  > 
  2048. >  > : How I tried it:
  2049. >  > :   OpenRgn
  2050. >  > :   DrawPict
  2051. >  > :   CloseRgn
  2052. >  > : Now the region is considerable smaller than the PICT.
  2053. >
  2054. > You might try HidePen and filtering some of the QuickDraw bottlenecks to
  2055. > keep track of the limits of drawing. You'll probably want to look up the
  2056. > calls SetStdProcs and SetStdCProcs in the aforementioned volumes for more
  2057. > info.
  2058.  
  2059. If he is looking for an outline, and the background of his picture is
  2060. white he might try opening the picture converting it to a black and white
  2061. image, and then doing a BitMapToRegion. 
  2062.  
  2063. We do this to get outlines for pictures we are dragging around. We on
  2064. occasion perform one more step that is making sure the picture is
  2065. displayed as an 8 bit image we turn all colors but white in the color
  2066. table to black before we convert it to a 1 bit image. This gives us a nice
  2067. outline we can use to convert to a region which gives us a nice outline
  2068. for dragging. Although we are going to look into this transparent drag
  2069. mode next.
  2070.  
  2071. Jer,
  2072.  
  2073. -- 
  2074. Jerome Jahnke
  2075. BSD Academic Computing
  2076. University of Chicago
  2077. j-jahnke@uchicago.edu
  2078.  
  2079.  
  2080. ---------------------------
  2081.  
  2082. >From steve@wco.com (Stephen Zagerman)
  2083. Subject: Quick way to tell if a file is open-busy?
  2084. Date: Wed, 20 Mar 1996 17:00:12 -0800
  2085. Organization: Stephen Zagerman Consulting
  2086.  
  2087. I'm writing an app (Client) that uses aevt's to tell another app (Server)
  2088. to take action that causes a new file to be created and written to. The
  2089. Client needs to then examine the file that the Server created, but should
  2090. not access it until the Server is done writing to it and has closed it.
  2091.  
  2092. This seems simple, but I can find any toolbox calls that let me know
  2093. whether a file is open or busy... Anyone know how to do it?
  2094.  
  2095. Thanks,
  2096.  
  2097. Steve
  2098.  
  2099. +++++++++++++++++++++++++++
  2100.  
  2101. >From kvictor@best.com (Ken Victor)
  2102. Date: Wed, 20 Mar 1996 19:50:25 -0800
  2103. Organization: Victor Consultin
  2104.  
  2105. In article <steve-2003961700120001@venus56.wco.com>, steve@wco.com
  2106. (Stephen Zagerman) wrote:
  2107.  
  2108. >This seems simple, but I can find any toolbox calls that let me know
  2109. >whether a file is open or busy... Anyone know how to do it?
  2110.  
  2111.  
  2112. PBGetCatInfo will return as part of the param block a refnum if the file
  2113. is already open, and the flags will indicate whether the resource/data
  2114. forks are open.
  2115.  
  2116. ken
  2117.  
  2118.  
  2119. +++++++++++++++++++++++++++
  2120.  
  2121. >From gregb@genmagic.com (Greg Branche)
  2122. Date: Tue, 26 Mar 1996 12:50:23 -0800
  2123. Organization: General Magic
  2124.  
  2125. In article <steve-2003961700120001@venus56.wco.com>, steve@wco.com
  2126. (Stephen Zagerman) wrote:
  2127.  
  2128. >I'm writing an app (Client) that uses aevt's to tell another app (Server)
  2129. >to take action that causes a new file to be created and written to. The
  2130. >Client needs to then examine the file that the Server created, but should
  2131. >not access it until the Server is done writing to it and has closed it.
  2132. >
  2133. >This seems simple, but I can find any toolbox calls that let me know
  2134. >whether a file is open or busy... Anyone know how to do it?
  2135. >
  2136.  
  2137. Take a look at PBGetCatInfo.  The ioFlAttrib field of the parameter block
  2138. has bits defined that'll let you know if the file is open, and
  2139. specifically which fork (or both forks, for that matter).
  2140.  
  2141. Greg Branche
  2142. Magic Cap Entomologist
  2143. General Magic, Inc.
  2144.  
  2145. +++++++++++++++++++++++++++
  2146.  
  2147. >From dbrosius@chesco.com (Dave M Brosius)
  2148. Date: 23 Mar 1996 08:20:12 GMT
  2149. Organization: Chester County Internet Services, Inc.
  2150.  
  2151. In article <steve-2003961700120001@venus56.wco.com>, steve@wco.com
  2152. (Stephen Zagerman) wrote:
  2153.  
  2154. > I'm writing an app (Client) that uses aevt's to tell another app (Server)
  2155. > to take action that causes a new file to be created and written to. The
  2156. > Client needs to then examine the file that the Server created, but should
  2157. > not access it until the Server is done writing to it and has closed it.
  2158. > This seems simple, but I can find any toolbox calls that let me know
  2159. > whether a file is open or busy... Anyone know how to do it?
  2160. > Thanks,
  2161. > Steve
  2162.  
  2163. PBGetCatInfo will return in ioFRefNum, an refnum of the first open access
  2164. path. If this value is 0, the file is closed.
  2165.  
  2166. -- 
  2167. Please reply via email as well
  2168. dave dbrosius@chesco.com
  2169. visit me at http://www.chesco.com/~dbrosius
  2170.  
  2171. ---------------------------
  2172.  
  2173. >From jwbaxter@olympus.net (John W. Baxter)
  2174. Subject: Trivia:  String length limit of 200
  2175. Date: 10 Mar 1996 23:32:05 GMT
  2176. Organization: Internet for the Olympic Peninsula
  2177.  
  2178. What string defined in the Mac Toolbox is limited to 200 characters?
  2179.     --John
  2180.  
  2181. -- 
  2182.   The month after next is May.
  2183. John W. Baxter    Port Ludlow, WA, USA     jwbaxter@olympus.net
  2184.  
  2185. +++++++++++++++++++++++++++
  2186.  
  2187. >From jumplong@aol.com (Jump Long)
  2188. Date: 16 Mar 1996 02:00:21 -0500
  2189. Organization: America Online, Inc. (1-800-827-6364)
  2190.  
  2191. John W. Baxter asked:
  2192. >What string defined in the Mac Toolbox is limited to 200
  2193. >characters?
  2194.  
  2195. Besides the comment string you pass to PBDTSetComment (my last answer), I
  2196. thought of another string that is about that length: The server message
  2197. string returned by the AppleTalk Filing Protocol in response to
  2198. afpGetSrvrMsg requests is a Str199 (200 bytes including the length
  2199. character).
  2200.  
  2201. By the way, nobody has taken a stab at the trivia reply question I posted:
  2202.  
  2203. >Now, here's another trivia question: What file system's Desktop
  2204. >Manager implementation returns 255 character comment strings to
  2205. >PBDTGetComment?
  2206.  
  2207. - Jim Luther
  2208.  
  2209. jumplong@aol.com
  2210. <http://members.aol.com/JumpLong/>
  2211.  
  2212. ---------------------------
  2213.  
  2214. >From bill@clavin.lmsc.lockheed.com (Bill Catambay)
  2215. Subject: [Ann] Pascal Central - Updated 3-18-96  (TCL page)
  2216. Date: Mon, 18 Mar 1996 09:37:19 -0800
  2217. Organization: MacPascal
  2218.  
  2219.  
  2220. To all Pascal programmers:
  2221.  
  2222. Check out the Pascal Central web site:
  2223.  
  2224. http://www.webcom.com/icog/polymorphic/pascal.html
  2225.  
  2226. The latest article posted to Pascal Central is "TCL Pascal LIVES!!!", a
  2227. collection of TCL source code tidbits for Pascal TCL programmers.  Check
  2228. out the page, and if you have any suggestions or additions to it, please
  2229. contact the editor of the page.
  2230.  
  2231. Pascal Central is a collection of Pascal-related content all in one
  2232. location to make it easier for the many Pascal developers out there to
  2233. cope in a world dominated by C and C++. 
  2234.  
  2235. If you have any pascal-related articles, documented source code or book
  2236. reviews you think would be of benefit to the Pascal community, let me
  2237. know.  Pascal Central is now going through adolescence, and I'm always
  2238. looking to the Pascal community to help mature its content.
  2239.  
  2240. Cheers,
  2241. Bill
  2242.  
  2243. _____________________________________________________________________
  2244. Bill Catambay
  2245. Pascal Programmer on Macintosh and Open VMS
  2246.  
  2247.               />
  2248.              //   The purpose of software engineering  
  2249.      (//////[O]>=========================================-
  2250.              \\    is to manage complexity, not to create it.
  2251.               \>
  2252.  
  2253. ____________________________________________________________________
  2254.         
  2255.  
  2256. ---------------------------
  2257.  
  2258. >From butt9580@uidaho.edu (Jared Buttles)
  2259. Subject: texture mapping
  2260. Date: Wed, 20 Mar 1996 11:13:54 -0800
  2261. Organization: University of Idaho, Moscow, Idaho
  2262.  
  2263. Does anyone out there know where I can find decent texture mapping
  2264. algorithms? Books, source, ftp sites, etc. Anything would be appreciated.
  2265. Thanx in advance.
  2266.  
  2267. +++++++++++++++++++++++++++
  2268.  
  2269. >From ericd@ra.nilenet.com (Eric A. Drumbor)
  2270. Date: Thu, 21 Mar 1996 06:41:08 -0700
  2271. Organization: BW Software
  2272.  
  2273. In article <butt9580-2003961113540001@xslip96.csrv.uidaho.edu>,
  2274. butt9580@uidaho.edu (Jared Buttles) wrote:
  2275.  
  2276. > Does anyone out there know where I can find decent texture mapping
  2277. > algorithms? Books, source, ftp sites, etc. Anything would be appreciated.
  2278. > Thanx in advance.
  2279.  
  2280.      Perspective or affine?  I assume you mean perspective, which is what
  2281. you want if you are looking for texture mapping that won't become
  2282. distorted when your viewer/camera/psycho-killer/ship/whatever is close to
  2283. the textured polygon.
  2284.  
  2285.      If you're completely new to texture mapping, you may want to try out
  2286. affine just to get an understanding of how perspective will work (to some
  2287. degree).  Michael Abrash's "Zen of Graphics Programming" describes affine
  2288. texture mapping fairly well, even though it's a PC book.  I'm sure there
  2289. are also some examples of affine on the x2ftp site, but I can't confirm
  2290. that.  After you have affine down, move on to perspective correct texture
  2291. mapping.  It's slower than affine, but visually speaking it's much better.
  2292.  
  2293.      There are books out there that describe texture mapping (I believe
  2294. it's Wolhberg's "Digital Image Warping") but personally I like Chris
  2295. Hecker's articles in Game Developer magazine.  They're clear, and so far
  2296. the code has been easily usable on the Mac (although I wrote my own
  2297. version in C).  You'll need to order back issues of Game Developer (BTW
  2298. they're bi-monthly):  April/May, June/July, Aug/Sept, and Dec/Jan.  
  2299.  
  2300.      Obviously, Kevin Tieskoetter's upcoming book should be really helpful too.
  2301.  
  2302.      Texture mapping (perspective correct) may seem difficult at first,
  2303. but once you have the basics down it's really quite easy to work with, and
  2304. optimize.
  2305.  
  2306. -- 
  2307. "I think the term rhymes with clucking bell..." - Black Adder
  2308. Eric A. Drumbor      
  2309. BW Software              <http://ra.nilenet.com/~ericd/>
  2310. ericd@ra.nilenet.com                 
  2311. For info on BW Software's upcoming 3D game, look at our web page:
  2312. http://ra.nilenet.com/~ericd/Aequator.html
  2313.  
  2314. +++++++++++++++++++++++++++
  2315.  
  2316. >From karm@bga.com (Kevin Armstrong)
  2317. Date: Thu, 21 Mar 1996 12:55:10 -0600
  2318. Organization: Lion Entertainment, Inc.
  2319.  
  2320. In article <butt9580-2003961113540001@xslip96.csrv.uidaho.edu>,
  2321. butt9580@uidaho.edu (Jared Buttles) wrote:
  2322.  
  2323. >Does anyone out there know where I can find decent texture mapping
  2324. >algorithms? Books, source, ftp sites, etc. Anything would be appreciated.
  2325. >Thanx in advance.
  2326.  
  2327. Michael Abrash's book Zen of Graphics Programming has a good Texture
  2328. Mapper in the back.  It doesn't do perspective, but it isn't too hard to
  2329. modify it to get it to do it.  And you'll probably want to optimize it a
  2330. bunch, but it is a good place to start.
  2331.  
  2332. The only problem from a Mac point of view is that most of the book is
  2333. about PC relevant stuff.  Lots of info on VGA and x86 assembly.
  2334.  
  2335. Kevin Armstrong
  2336. Lion Entertainment, Inc.
  2337.  
  2338. +++++++++++++++++++++++++++
  2339.  
  2340. >From blossom@slip.net (Jon Blossom)
  2341. Date: Fri, 22 Mar 1996 18:27:44 GMT
  2342. Organization: (none)
  2343.  
  2344. butt9580@uidaho.edu (Jared Buttles) wrote:
  2345.  
  2346. >Does anyone out there know where I can find decent texture mapping
  2347. >algorithms? Books, source, ftp sites, etc. Anything would be appreciated.
  2348. >Thanx in advance.
  2349.  
  2350. Chris Hecker wrote an excellent series about perspective texture
  2351. mapping in Game Developer magazine.
  2352.  
  2353. Check out ftp://ftp.mfi.com/pub/gamedev/src, and/or
  2354. http://www.mfi.com/gdmag.
  2355.  
  2356. I think he's planning on making it available on his homepage, which
  2357. may or may not be up yet. http://www.nwlink.com/~checker.
  2358.  
  2359. -Jon Blossom
  2360. blossom@slip.net
  2361.  
  2362.  
  2363.  
  2364. ---------------------------
  2365.  
  2366. End of C.S.M.P. Digest
  2367. **********************
  2368.  
  2369.  
  2370.  
  2371.